<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The AQUA Project, Glasgow University, 1994-1998

\section[ErrsUtils]{Utilities for error reporting}
-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Utils.Error</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Basic types</span></span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier">Validity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#andValid"><span class="hs-identifier">andValid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#allValid"><span class="hs-identifier">allValid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#isValid"><span class="hs-identifier">isValid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#getInvalids"><span class="hs-identifier">getInvalids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#orValid"><span class="hs-identifier">orValid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier">Severity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Messages</span></span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier">ErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errMsgDoc"><span class="hs-identifier">errMsgDoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier">errMsgSeverity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier">errMsgReason</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier">ErrDoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errDoc"><span class="hs-identifier">errDoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errDocImportant"><span class="hs-identifier">errDocImportant</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errDocContext"><span class="hs-identifier">errDocContext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errDocSupplementary"><span class="hs-identifier">errDocSupplementary</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#WarnMsg"><span class="hs-identifier">WarnMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier">MsgDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier">Messages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrorMessages"><span class="hs-identifier">ErrorMessages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#WarningMessages"><span class="hs-identifier">WarningMessages</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#unionMessages"><span class="hs-identifier">unionMessages</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier">errMsgSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#errMsgContext"><span class="hs-identifier">errMsgContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#errorsFound"><span class="hs-identifier">errorsFound</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#isEmptyMessages"><span class="hs-identifier">isEmptyMessages</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#isWarnMsgFatal"><span class="hs-identifier">isWarnMsgFatal</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#warningsToMessages"><span class="hs-identifier">warningsToMessages</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Formatting</span></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#pprMessageBag"><span class="hs-identifier">pprMessageBag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#pprErrMsgBagWithLoc"><span class="hs-identifier">pprErrMsgBagWithLoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#pprLocErrMsg"><span class="hs-identifier">pprLocErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#printBagOfErrors"><span class="hs-identifier">printBagOfErrors</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#formatErrDoc"><span class="hs-identifier">formatErrDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Construction</span></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#emptyMessages"><span class="hs-identifier">emptyMessages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkLocMessage"><span class="hs-identifier">mkLocMessage</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkLocMessageAnn"><span class="hs-identifier">mkLocMessageAnn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#makeIntoWarning"><span class="hs-identifier">makeIntoWarning</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#mkErrMsg"><span class="hs-identifier">mkErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkPlainErrMsg"><span class="hs-identifier">mkPlainErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkErrDoc"><span class="hs-identifier">mkErrDoc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkLongErrMsg"><span class="hs-identifier">mkLongErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkWarnMsg"><span class="hs-identifier">mkWarnMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#mkPlainWarnMsg"><span class="hs-identifier">mkPlainWarnMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#mkLongWarnMsg"><span class="hs-identifier">mkLongWarnMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Utilities</span></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#doIfSet"><span class="hs-identifier">doIfSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#doIfSet_dyn"><span class="hs-identifier">doIfSet_dyn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#getCaretDiagnostic"><span class="hs-identifier">getCaretDiagnostic</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Dump files</span></span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier">dumpIfSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier">dumpIfSet_dyn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier">dumpIfSet_dyn_printer</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#dumpOptionsFromFlag"><span class="hs-identifier">dumpOptionsFromFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier">DumpOptions</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier">DumpFormat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpAction"><span class="hs-identifier">DumpAction</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpAction"><span class="hs-identifier">dumpAction</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#defaultDumpAction"><span class="hs-identifier">defaultDumpAction</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#TraceAction"><span class="hs-identifier">TraceAction</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#traceAction"><span class="hs-identifier">traceAction</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#defaultTraceAction"><span class="hs-identifier">defaultTraceAction</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#touchDumpFile"><span class="hs-identifier">touchDumpFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Issuing messages during compilation</span></span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier">putMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#printInfoForUser"><span class="hs-identifier">printInfoForUser</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#printOutputForUser"><span class="hs-identifier">printOutputForUser</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier">logInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#logOutput"><span class="hs-identifier">logOutput</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#errorMsg"><span class="hs-identifier">errorMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#warningMsg"><span class="hs-identifier">warningMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#fatalErrorMsg"><span class="hs-identifier">fatalErrorMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier">fatalErrorMsg''</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#compilationProgressMsg"><span class="hs-identifier">compilationProgressMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier">showPass</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier">withTiming</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#withTimingSilent"><span class="hs-identifier">withTimingSilent</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier">withTimingD</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#withTimingSilentD"><span class="hs-identifier">withTimingSilentD</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier">debugTraceMsg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#ghcExit"><span class="hs-identifier">ghcExit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#prettyPrintGhcErrors"><span class="hs-identifier">prettyPrintGhcErrors</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><a href="GHC.Utils.Error.html#traceCmd"><span class="hs-identifier">traceCmd</span></a></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html"><span class="hs-identifier">GHC.Utils.Exception</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Outputable</span></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Utils.Ppr.Colour.html"><span class="hs-identifier">GHC.Utils.Ppr.Colour</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Col</span></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier">unpackFS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html"><span class="hs-identifier">GHC.Data.StringBuffer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.StringBuffer.html#atLine"><span class="hs-identifier">atLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html#hGetStringBuffer"><span class="hs-identifier">hGetStringBuffer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html#len"><span class="hs-identifier">len</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html#lexemeToString"><span class="hs-identifier">lexemeToString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Json.html"><span class="hs-identifier">GHC.Utils.Json</span></a></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#"><span class="hs-identifier">System.Exit</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier">ExitCode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier">exitWith</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier">takeDirectory</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier">fromMaybe</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.html#"><span class="hs-identifier">Data.Time</span></a></span><span>
</span><span id="line-89"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Debug.Trace.html#"><span class="hs-identifier">Debug.Trace</span></a></span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#"><span class="hs-identifier">Control.Monad.IO.Class</span></a></span><span>
</span><span id="line-92"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#"><span class="hs-identifier">Control.Monad.Catch</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">MC</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#handle"><span class="hs-identifier">handle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#catchIOError"><span class="hs-identifier">catchIOError</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Conc.html#"><span class="hs-identifier">GHC.Conc</span></a></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#getAllocationCounter"><span class="hs-identifier">getAllocationCounter</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.CPUTime.html#"><span class="hs-identifier">System.CPUTime</span></a></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="hs-comment">-------------------------</span><span>
</span><span id="line-99"></span><span class="hs-keyword">type</span><span> </span><span id="MsgDoc"><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-var">MsgDoc</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-comment">-------------------------</span><span>
</span><span id="line-102"></span><span class="hs-keyword">data</span><span> </span><span id="Validity"><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-var">Validity</span></a></span></span><span>
</span><span id="line-103"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="IsValid"><span class="annot"><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span></span><span>            </span><span class="hs-comment">-- ^ Everything is fine</span><span>
</span><span id="line-104"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NotValid"><span class="annot"><a href="GHC.Utils.Error.html#NotValid"><span class="hs-identifier hs-var">NotValid</span></a></span></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>    </span><span class="hs-comment">-- ^ A problem, and some indication of why</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="annot"><a href="GHC.Utils.Error.html#isValid"><span class="hs-identifier hs-type">isValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-107"></span><span id="isValid"><span class="annot"><span class="annottext">isValid :: Validity -&gt; Bool
</span><a href="GHC.Utils.Error.html#isValid"><span class="hs-identifier hs-var hs-var">isValid</span></a></span></span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-108"></span><span class="annot"><a href="GHC.Utils.Error.html#isValid"><span class="hs-identifier hs-var">isValid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#NotValid"><span class="hs-identifier hs-type">NotValid</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="annot"><a href="GHC.Utils.Error.html#andValid"><span class="hs-identifier hs-type">andValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span>
</span><span id="line-111"></span><span id="andValid"><span class="annot"><span class="annottext">andValid :: Validity -&gt; Validity -&gt; Validity
</span><a href="GHC.Utils.Error.html#andValid"><span class="hs-identifier hs-var hs-var">andValid</span></a></span></span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span><span> </span><span id="local-6989586621680826427"><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826427"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826427"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-112"></span><span class="annot"><a href="GHC.Utils.Error.html#andValid"><span class="hs-identifier hs-var">andValid</span></a></span><span> </span><span id="local-6989586621680826426"><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826426"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">Validity
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826426"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">-- | If they aren't all valid, return the first</span><span>
</span><span id="line-115"></span><span class="annot"><a href="GHC.Utils.Error.html#allValid"><span class="hs-identifier hs-type">allValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span>
</span><span id="line-116"></span><span id="allValid"><span class="annot"><span class="annottext">allValid :: [Validity] -&gt; Validity
</span><a href="GHC.Utils.Error.html#allValid"><span class="hs-identifier hs-var hs-var">allValid</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span><span>
</span><span id="line-117"></span><span class="annot"><a href="GHC.Utils.Error.html#allValid"><span class="hs-identifier hs-var">allValid</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826425"><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826425"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680826424"><span class="annot"><span class="annottext">[Validity]
</span><a href="#local-6989586621680826424"><span class="hs-identifier hs-var">vs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826425"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Validity -&gt; Validity -&gt; Validity
</span><a href="GHC.Utils.Error.html#andValid"><span class="hs-operator hs-var">`andValid`</span></a></span><span> </span><span class="annot"><span class="annottext">[Validity] -&gt; Validity
</span><a href="GHC.Utils.Error.html#allValid"><span class="hs-identifier hs-var">allValid</span></a></span><span> </span><span class="annot"><span class="annottext">[Validity]
</span><a href="#local-6989586621680826424"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Utils.Error.html#getInvalids"><span class="hs-identifier hs-type">getInvalids</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-120"></span><span id="getInvalids"><span class="annot"><span class="annottext">getInvalids :: [Validity] -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#getInvalids"><span class="hs-identifier hs-var hs-var">getInvalids</span></a></span></span><span> </span><span id="local-6989586621680826423"><span class="annot"><span class="annottext">[Validity]
</span><a href="#local-6989586621680826423"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826422"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#NotValid"><span class="hs-identifier hs-type">NotValid</span></a></span><span> </span><span id="local-6989586621680826422"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826422"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Validity]
</span><a href="#local-6989586621680826423"><span class="hs-identifier hs-var">vs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="GHC.Utils.Error.html#orValid"><span class="hs-identifier hs-type">orValid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Validity"><span class="hs-identifier hs-type">Validity</span></a></span><span>
</span><span id="line-123"></span><span id="orValid"><span class="annot"><span class="annottext">orValid :: Validity -&gt; Validity -&gt; Validity
</span><a href="GHC.Utils.Error.html#orValid"><span class="hs-identifier hs-var hs-var">orValid</span></a></span></span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span><span> </span><span class="annot"><span class="annottext">Validity
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="GHC.Utils.Error.html#IsValid"><span class="hs-identifier hs-var">IsValid</span></a></span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.Utils.Error.html#orValid"><span class="hs-identifier hs-var">orValid</span></a></span><span> </span><span class="annot"><span class="annottext">Validity
</span><span class="hs-identifier">_</span></span><span>       </span><span id="local-6989586621680826421"><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826421"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Validity
</span><a href="#local-6989586621680826421"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- Basic error messages: just render a message with a source location.</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-keyword">type</span><span> </span><span id="Messages"><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-var">Messages</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#WarningMessages"><span class="hs-identifier hs-type">WarningMessages</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrorMessages"><span class="hs-identifier hs-type">ErrorMessages</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span class="hs-keyword">type</span><span> </span><span id="WarningMessages"><span class="annot"><a href="GHC.Utils.Error.html#WarningMessages"><span class="hs-identifier hs-var">WarningMessages</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#WarnMsg"><span class="hs-identifier hs-type">WarnMsg</span></a></span><span>
</span><span id="line-131"></span><span class="hs-keyword">type</span><span> </span><span id="ErrorMessages"><span class="annot"><a href="GHC.Utils.Error.html#ErrorMessages"><span class="hs-identifier hs-var">ErrorMessages</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="annot"><a href="GHC.Utils.Error.html#unionMessages"><span class="hs-identifier hs-type">unionMessages</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span>
</span><span id="line-134"></span><span id="unionMessages"><span class="annot"><span class="annottext">unionMessages :: Messages -&gt; Messages -&gt; Messages
</span><a href="GHC.Utils.Error.html#unionMessages"><span class="hs-identifier hs-var hs-var">unionMessages</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826420"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826420"><span class="hs-identifier hs-var">warns1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826419"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826419"><span class="hs-identifier hs-var">errs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826418"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826418"><span class="hs-identifier hs-var">warns2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826417"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826417"><span class="hs-identifier hs-var">errs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-135"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826420"><span class="hs-identifier hs-var">warns1</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages -&gt; WarningMessages -&gt; WarningMessages
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826418"><span class="hs-identifier hs-var">warns2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826419"><span class="hs-identifier hs-var">errs1</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages -&gt; WarningMessages -&gt; WarningMessages
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826417"><span class="hs-identifier hs-var">errs2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-keyword">data</span><span> </span><span id="ErrMsg"><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-var">ErrMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ErrMsg"><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-var">ErrMsg</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-138"></span><span>        </span><span id="errMsgSpan"><span class="annot"><span class="annottext">ErrMsg -&gt; SrcSpan
</span><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier hs-var hs-var">errMsgSpan</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-139"></span><span>        </span><span id="errMsgContext"><span class="annot"><span class="annottext">ErrMsg -&gt; PrintUnqualified
</span><a href="GHC.Utils.Error.html#errMsgContext"><span class="hs-identifier hs-var hs-var">errMsgContext</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-140"></span><span>        </span><span id="errMsgDoc"><span class="annot"><span class="annottext">ErrMsg -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#errMsgDoc"><span class="hs-identifier hs-var hs-var">errMsgDoc</span></a></span></span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-141"></span><span>        </span><span class="hs-comment">-- | This has the same text as errDocImportant . errMsgDoc.</span><span>
</span><span id="line-142"></span><span>        </span><span id="errMsgShortString"><span class="annot"><span class="annottext">ErrMsg -&gt; FilePath
</span><a href="GHC.Utils.Error.html#errMsgShortString"><span class="hs-identifier hs-var hs-var">errMsgShortString</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-143"></span><span>        </span><span id="errMsgSeverity"><span class="annot"><span class="annottext">ErrMsg -&gt; Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var hs-var">errMsgSeverity</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-144"></span><span>        </span><span id="errMsgReason"><span class="annot"><span class="annottext">ErrMsg -&gt; WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var hs-var">errMsgReason</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarnReason"><span class="hs-identifier hs-type">WarnReason</span></a></span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-comment">-- The SrcSpan is used for sorting errors into line-number order</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="hs-comment">-- | Categorise error msgs by their importance.  This is so each section can</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- be rendered visually distinct.  See Note [Error report] for where these come</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- from.</span><span>
</span><span id="line-152"></span><span class="hs-keyword">data</span><span> </span><span id="ErrDoc"><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ErrDoc"><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-153"></span><span>        </span><span class="hs-comment">-- | Primary error msg.</span><span>
</span><span id="line-154"></span><span>        </span><span id="errDocImportant"><span class="annot"><span class="annottext">ErrDoc -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#errDocImportant"><span class="hs-identifier hs-var hs-var">errDocImportant</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-155"></span><span>        </span><span class="hs-comment">-- | Context e.g. \&quot;In the second argument of ...\&quot;.</span><span>
</span><span id="line-156"></span><span>        </span><span id="errDocContext"><span class="annot"><span class="annottext">ErrDoc -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#errDocContext"><span class="hs-identifier hs-var hs-var">errDocContext</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-157"></span><span>        </span><span class="hs-comment">-- | Supplementary information, e.g. \&quot;Relevant bindings include ...\&quot;.</span><span>
</span><span id="line-158"></span><span>        </span><span id="errDocSupplementary"><span class="annot"><span class="annottext">ErrDoc -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#errDocSupplementary"><span class="hs-identifier hs-var hs-var">errDocSupplementary</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-159"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span class="annot"><a href="GHC.Utils.Error.html#errDoc"><span class="hs-identifier hs-type">errDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span>
</span><span id="line-162"></span><span id="errDoc"><span class="annot"><span class="annottext">errDoc :: [MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#errDoc"><span class="hs-identifier hs-var hs-var">errDoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-keyword">type</span><span> </span><span id="WarnMsg"><span class="annot"><a href="GHC.Utils.Error.html#WarnMsg"><span class="hs-identifier hs-var">WarnMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-keyword">data</span><span> </span><span id="Severity"><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-var">Severity</span></a></span></span><span>
</span><span id="line-167"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="SevOutput"><span class="annot"><a href="GHC.Utils.Error.html#SevOutput"><span class="hs-identifier hs-var">SevOutput</span></a></span></span><span>
</span><span id="line-168"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevFatal"><span class="annot"><a href="GHC.Utils.Error.html#SevFatal"><span class="hs-identifier hs-var">SevFatal</span></a></span></span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevInteractive"><span class="annot"><a href="GHC.Utils.Error.html#SevInteractive"><span class="hs-identifier hs-var">SevInteractive</span></a></span></span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevDump"><span class="annot"><a href="GHC.Utils.Error.html#SevDump"><span class="hs-identifier hs-var">SevDump</span></a></span></span><span>
</span><span id="line-172"></span><span>    </span><span class="hs-comment">-- ^ Log message intended for compiler developers</span><span>
</span><span id="line-173"></span><span>    </span><span class="hs-comment">-- No file\/line\/column stuff</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevInfo"><span class="annot"><a href="GHC.Utils.Error.html#SevInfo"><span class="hs-identifier hs-var">SevInfo</span></a></span></span><span>
</span><span id="line-176"></span><span>    </span><span class="hs-comment">-- ^ Log messages intended for end users.</span><span>
</span><span id="line-177"></span><span>    </span><span class="hs-comment">-- No file\/line\/column stuff.</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevWarning"><span class="annot"><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span></span><span>
</span><span id="line-180"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SevError"><span class="annot"><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span></span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-comment">-- ^ SevWarning and SevError are used for warnings and errors</span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-comment">--   o The message has a file\/line\/column heading,</span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-comment">--     plus &quot;warning:&quot; or &quot;error:&quot;,</span><span>
</span><span id="line-184"></span><span>    </span><span class="hs-comment">--     added by mkLocMessags</span><span>
</span><span id="line-185"></span><span>    </span><span class="hs-comment">--   o Output is intended for end users</span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621680826400"><span id="local-6989586621680826402"><span id="local-6989586621680826404"><span class="annot"><span class="annottext">Int -&gt; Severity -&gt; ShowS
[Severity] -&gt; ShowS
Severity -&gt; FilePath
(Int -&gt; Severity -&gt; ShowS)
-&gt; (Severity -&gt; FilePath) -&gt; ([Severity] -&gt; ShowS) -&gt; Show Severity
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; FilePath) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Severity] -&gt; ShowS
$cshowList :: [Severity] -&gt; ShowS
show :: Severity -&gt; FilePath
$cshow :: Severity -&gt; FilePath
showsPrec :: Int -&gt; Severity -&gt; ShowS
$cshowsPrec :: Int -&gt; Severity -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Utils.Json.html#ToJson"><span class="hs-identifier hs-type">ToJson</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-190"></span><span>  </span><span id="local-6989586621680826394"><span class="annot"><span class="annottext">json :: Severity -&gt; JsonDoc
</span><a href="GHC.Utils.Json.html#json"><span class="hs-identifier hs-var hs-var hs-var hs-var">json</span></a></span></span><span> </span><span id="local-6989586621680826392"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826392"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; JsonDoc
</span><a href="GHC.Utils.Json.html#JSString"><span class="hs-identifier hs-var">JSString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Severity -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826392"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680826385"><span id="local-6989586621680826388"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-194"></span><span>    </span><span id="local-6989586621680826384"><span class="annot"><span class="annottext">show :: ErrMsg -&gt; FilePath
</span><a href="#local-6989586621680826384"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span id="local-6989586621680826383"><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826383"><span class="hs-identifier hs-var">em</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; FilePath
</span><a href="GHC.Utils.Error.html#errMsgShortString"><span class="hs-identifier hs-var hs-var">errMsgShortString</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826383"><span class="hs-identifier hs-var">em</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="annot"><a href="GHC.Utils.Error.html#pprMessageBag"><span class="hs-identifier hs-type">pprMessageBag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-197"></span><span id="pprMessageBag"><span class="annot"><span class="annottext">pprMessageBag :: Bag MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#pprMessageBag"><span class="hs-identifier hs-var hs-var">pprMessageBag</span></a></span></span><span> </span><span id="local-6989586621680826382"><span class="annot"><span class="annottext">Bag MsgDoc
</span><a href="#local-6989586621680826382"><span class="hs-identifier hs-var">msgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; [MsgDoc] -&gt; [MsgDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag MsgDoc -&gt; [MsgDoc]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="annot"><span class="annottext">Bag MsgDoc
</span><a href="#local-6989586621680826382"><span class="hs-identifier hs-var">msgs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-comment">-- | Make an unannotated error message with location info.</span><span>
</span><span id="line-200"></span><span class="annot"><a href="GHC.Utils.Error.html#mkLocMessage"><span class="hs-identifier hs-type">mkLocMessage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>
</span><span id="line-201"></span><span id="mkLocMessage"><span class="annot"><span class="annottext">mkLocMessage :: Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkLocMessage"><span class="hs-identifier hs-var hs-var">mkLocMessage</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkLocMessageAnn"><span class="hs-identifier hs-var">mkLocMessageAnn</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="hs-comment">-- | Make a possibly annotated error message with location info.</span><span>
</span><span id="line-204"></span><span class="annot"><a href="GHC.Utils.Error.html#mkLocMessageAnn"><span class="hs-identifier hs-type">mkLocMessageAnn</span></a></span><span>
</span><span id="line-205"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>                       </span><span class="hs-comment">-- ^ optional annotation</span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span>                           </span><span class="hs-comment">-- ^ severity</span><span>
</span><span id="line-207"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>                            </span><span class="hs-comment">-- ^ location</span><span>
</span><span id="line-208"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>                             </span><span class="hs-comment">-- ^ message</span><span>
</span><span id="line-209"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>
</span><span id="line-210"></span><span>  </span><span class="hs-comment">-- Always print the location, even if it is unhelpful.  Error messages</span><span>
</span><span id="line-211"></span><span>  </span><span class="hs-comment">-- are supposed to be in a standard format, and one without a location</span><span>
</span><span id="line-212"></span><span>  </span><span class="hs-comment">-- would look strange.  Better to say explicitly &quot;&lt;no location info&gt;&quot;.</span><span>
</span><span id="line-213"></span><span id="mkLocMessageAnn"><span class="annot"><span class="annottext">mkLocMessageAnn :: Maybe FilePath -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkLocMessageAnn"><span class="hs-identifier hs-var hs-var">mkLocMessageAnn</span></a></span></span><span> </span><span id="local-6989586621680826377"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621680826377"><span class="hs-identifier hs-var">ann</span></a></span></span><span> </span><span id="local-6989586621680826376"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826376"><span class="hs-identifier hs-var">severity</span></a></span></span><span> </span><span id="local-6989586621680826375"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826375"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826374"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826374"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SDocContext -&gt; Scheme) -&gt; (Scheme -&gt; MsgDoc) -&gt; MsgDoc
forall a. (SDocContext -&gt; a) -&gt; (a -&gt; MsgDoc) -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sdocOption"><span class="hs-identifier hs-var">sdocOption</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; Scheme
</span><a href="GHC.Utils.Outputable.html#sdocColScheme"><span class="hs-identifier hs-var hs-var">sdocColScheme</span></a></span><span> </span><span class="annot"><span class="annottext">((Scheme -&gt; MsgDoc) -&gt; MsgDoc) -&gt; (Scheme -&gt; MsgDoc) -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680826371"><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826371"><span class="hs-identifier hs-var">col_scheme</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-215"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826366"><span class="annot"><span class="annottext">locn' :: MsgDoc
</span><a href="#local-6989586621680826366"><span class="hs-identifier hs-var hs-var">locn'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SDocContext -&gt; Bool) -&gt; (Bool -&gt; MsgDoc) -&gt; MsgDoc
forall a. (SDocContext -&gt; a) -&gt; (a -&gt; MsgDoc) -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sdocOption"><span class="hs-identifier hs-var">sdocOption</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; Bool
</span><a href="GHC.Utils.Outputable.html#sdocErrorSpans"><span class="hs-identifier hs-var hs-var">sdocErrorSpans</span></a></span><span> </span><span class="annot"><span class="annottext">((Bool -&gt; MsgDoc) -&gt; MsgDoc) -&gt; (Bool -&gt; MsgDoc) -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-216"></span><span>                     </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826375"><span class="hs-identifier hs-var">locn</span></a></span><span>
</span><span id="line-217"></span><span>                     </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SrcLoc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcLoc
</span><a href="GHC.Types.SrcLoc.html#srcSpanStart"><span class="hs-identifier hs-var">srcSpanStart</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826375"><span class="hs-identifier hs-var">locn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>          </span><span id="local-6989586621680826362"><span class="annot"><span class="annottext">sevColour :: PprColour
</span><a href="#local-6989586621680826362"><span class="hs-identifier hs-var hs-var">sevColour</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity -&gt; Scheme -&gt; PprColour
</span><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var">getSeverityColour</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826376"><span class="hs-identifier hs-var">severity</span></a></span><span> </span><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826371"><span class="hs-identifier hs-var">col_scheme</span></a></span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span>          </span><span class="hs-comment">-- Add optional information</span><span>
</span><span id="line-222"></span><span>          </span><span id="local-6989586621680826360"><span class="annot"><span class="annottext">optAnn :: MsgDoc
</span><a href="#local-6989586621680826360"><span class="hs-identifier hs-var hs-var">optAnn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621680826377"><span class="hs-identifier hs-var">ann</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-223"></span><span>            </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-224"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826358"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826358"><span class="hs-identifier hs-var">i</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; [&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826362"><span class="hs-identifier hs-var">sevColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826358"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;]&quot;</span></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span>          </span><span class="hs-comment">-- Add prefixes, like    Foo.hs:34: warning:</span><span>
</span><span id="line-227"></span><span>          </span><span class="hs-comment">--                           &lt;the warning message&gt;</span><span>
</span><span id="line-228"></span><span>          </span><span id="local-6989586621680826355"><span class="annot"><span class="annottext">header :: MsgDoc
</span><a href="#local-6989586621680826355"><span class="hs-identifier hs-var hs-var">header</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826366"><span class="hs-identifier hs-var">locn'</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-229"></span><span>                   </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826362"><span class="hs-identifier hs-var">sevColour</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826352"><span class="hs-identifier hs-var">sevText</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826360"><span class="hs-identifier hs-var">optAnn</span></a></span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sMessage"><span class="hs-identifier hs-var hs-var">Col.sMessage</span></a></span><span> </span><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826371"><span class="hs-identifier hs-var">col_scheme</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sHeader"><span class="hs-identifier hs-var hs-var">Col.sHeader</span></a></span><span> </span><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826371"><span class="hs-identifier hs-var">col_scheme</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826355"><span class="hs-identifier hs-var">header</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-233"></span><span>                        </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826374"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-236"></span><span>    </span><span id="local-6989586621680826352"><span class="annot"><span class="annottext">sevText :: MsgDoc
</span><a href="#local-6989586621680826352"><span class="hs-identifier hs-var hs-var">sevText</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-237"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826376"><span class="hs-identifier hs-var">severity</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-238"></span><span>        </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;warning:&quot;</span></span><span>
</span><span id="line-239"></span><span>        </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;error:&quot;</span></span><span>
</span><span id="line-240"></span><span>        </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevFatal"><span class="hs-identifier hs-var">SevFatal</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;fatal:&quot;</span></span><span>
</span><span id="line-241"></span><span>        </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="annot"><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-type">getSeverityColour</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Ppr.Colour.html#Scheme"><span class="hs-identifier hs-type">Col.Scheme</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Ppr.Colour.html#PprColour"><span class="hs-identifier hs-type">Col.PprColour</span></a></span><span>
</span><span id="line-244"></span><span id="getSeverityColour"><span class="annot"><span class="annottext">getSeverityColour :: Severity -&gt; Scheme -&gt; PprColour
</span><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var hs-var">getSeverityColour</span></a></span></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sWarning"><span class="hs-identifier hs-var hs-var">Col.sWarning</span></a></span><span>
</span><span id="line-245"></span><span class="annot"><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var">getSeverityColour</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sError"><span class="hs-identifier hs-var hs-var">Col.sError</span></a></span><span>
</span><span id="line-246"></span><span class="annot"><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var">getSeverityColour</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevFatal"><span class="hs-identifier hs-var">SevFatal</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sFatal"><span class="hs-identifier hs-var hs-var">Col.sFatal</span></a></span><span>
</span><span id="line-247"></span><span class="annot"><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var">getSeverityColour</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PprColour -&gt; Scheme -&gt; PprColour
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="annot"><a href="GHC.Utils.Error.html#getCaretDiagnostic"><span class="hs-identifier hs-type">getCaretDiagnostic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>
</span><span id="line-250"></span><span id="getCaretDiagnostic"><span class="annot"><span class="annottext">getCaretDiagnostic :: Severity -&gt; SrcSpan -&gt; IO MsgDoc
</span><a href="GHC.Utils.Error.html#getCaretDiagnostic"><span class="hs-identifier hs-var hs-var">getCaretDiagnostic</span></a></span></span><span> </span><span class="annot"><span class="annottext">Severity
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IO MsgDoc
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-251"></span><span class="annot"><a href="GHC.Utils.Error.html#getCaretDiagnostic"><span class="hs-identifier hs-var">getCaretDiagnostic</span></a></span><span> </span><span id="local-6989586621680826342"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826342"><span class="hs-identifier hs-var">severity</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621680826340"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-252"></span><span>  </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; MsgDoc
</span><a href="#local-6989586621680826339"><span class="hs-identifier hs-var">caretDiagnostic</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FilePath -&gt; MsgDoc) -&gt; IO (Maybe FilePath) -&gt; IO MsgDoc
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; IO (Maybe FilePath)
</span><a href="#local-6989586621680826337"><span class="hs-identifier hs-var">getSrcLine</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcSpan -&gt; FastString
</span><a href="GHC.Types.SrcLoc.html#srcSpanFile"><span class="hs-identifier hs-var hs-var">srcSpanFile</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826335"><span class="hs-identifier hs-var">row</span></a></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-255"></span><span>    </span><span id="local-6989586621680826337"><span class="annot"><span class="annottext">getSrcLine :: FastString -&gt; Int -&gt; IO (Maybe FilePath)
</span><a href="#local-6989586621680826337"><span class="hs-identifier hs-var hs-var">getSrcLine</span></a></span></span><span> </span><span id="local-6989586621680826333"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680826333"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span id="local-6989586621680826332"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826332"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-256"></span><span>      </span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; IO (Maybe FilePath)
</span><a href="#local-6989586621680826331"><span class="hs-identifier hs-var">getLine</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826332"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680826333"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>        </span><span class="annot"><span class="annottext">IO (Maybe FilePath)
-&gt; (IOError -&gt; IO (Maybe FilePath)) -&gt; IO (Maybe FilePath)
forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#catchIOError"><span class="hs-operator hs-var">`catchIOError`</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">IOError
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-258"></span><span>          </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span>    </span><span id="local-6989586621680826331"><span class="annot"><span class="annottext">getLine :: Int -&gt; FilePath -&gt; IO (Maybe FilePath)
</span><a href="#local-6989586621680826331"><span class="hs-identifier hs-var hs-var">getLine</span></a></span></span><span> </span><span id="local-6989586621680826325"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826325"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621680826324"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826324"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-261"></span><span>      </span><span class="hs-comment">-- StringBuffer has advantages over readFile:</span><span>
</span><span id="line-262"></span><span>      </span><span class="hs-comment">-- (a) no lazy IO, otherwise IO exceptions may occur in pure code</span><span>
</span><span id="line-263"></span><span>      </span><span class="hs-comment">-- (b) always UTF-8, rather than some system-dependent encoding</span><span>
</span><span id="line-264"></span><span>      </span><span class="hs-comment">--     (Haskell source code must be UTF-8 anyway)</span><span>
</span><span id="line-265"></span><span>      </span><span id="local-6989586621680826323"><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621680826323"><span class="hs-identifier hs-var">content</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO StringBuffer
</span><a href="GHC.Data.StringBuffer.html#hGetStringBuffer"><span class="hs-identifier hs-var">hGetStringBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826324"><span class="hs-identifier hs-var">fn</span></a></span><span>
</span><span id="line-266"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; StringBuffer -&gt; Maybe StringBuffer
</span><a href="GHC.Data.StringBuffer.html#atLine"><span class="hs-identifier hs-var">atLine</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826325"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621680826323"><span class="hs-identifier hs-var">content</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-267"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826322"><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621680826322"><span class="hs-identifier hs-var">at_line</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FilePath -&gt; IO (Maybe FilePath))
-&gt; Maybe FilePath -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-268"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [FilePath]
</span><a href="../../base/src/Data.OldList.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621680826320"><span class="hs-identifier hs-var">fix</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; ShowS
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer -&gt; Int -&gt; FilePath
</span><a href="GHC.Data.StringBuffer.html#lexemeToString"><span class="hs-identifier hs-var">lexemeToString</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621680826322"><span class="hs-identifier hs-var">at_line</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StringBuffer -&gt; Int
</span><a href="GHC.Data.StringBuffer.html#len"><span class="hs-identifier hs-var hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621680826322"><span class="hs-identifier hs-var">at_line</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-269"></span><span>            </span><span id="local-6989586621680826319"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826319"><span class="hs-identifier hs-var">srcLine</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826319"><span class="hs-identifier hs-var">srcLine</span></a></span><span>
</span><span id="line-270"></span><span>            </span><span class="annot"><span class="annottext">[FilePath]
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-271"></span><span>        </span><span class="annot"><span class="annottext">Maybe StringBuffer
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>    </span><span class="hs-comment">-- allow user to visibly see that their code is incorrectly encoded</span><span>
</span><span id="line-274"></span><span>    </span><span class="hs-comment">-- (StringBuffer.nextChar uses \0 to represent undecodable characters)</span><span>
</span><span id="line-275"></span><span>    </span><span id="local-6989586621680826320"><span class="annot"><span class="annottext">fix :: Char -&gt; Char
</span><a href="#local-6989586621680826320"><span class="hs-identifier hs-var hs-var">fix</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\0'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\xfffd'</span></span><span>
</span><span id="line-276"></span><span>    </span><span class="annot"><a href="#local-6989586621680826320"><span class="hs-identifier hs-var">fix</span></a></span><span> </span><span id="local-6989586621680826318"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826318"><span class="hs-identifier hs-var">c</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826318"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span>    </span><span id="local-6989586621680826335"><span class="annot"><span class="annottext">row :: Int
</span><a href="#local-6989586621680826335"><span class="hs-identifier hs-var hs-var">row</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanStartLine"><span class="hs-identifier hs-var">srcSpanStartLine</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-279"></span><span>    </span><span id="local-6989586621680826314"><span class="annot"><span class="annottext">rowStr :: FilePath
</span><a href="#local-6989586621680826314"><span class="hs-identifier hs-var hs-var">rowStr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826335"><span class="hs-identifier hs-var">row</span></a></span><span>
</span><span id="line-280"></span><span>    </span><span id="local-6989586621680826312"><span class="annot"><span class="annottext">multiline :: Bool
</span><a href="#local-6989586621680826312"><span class="hs-identifier hs-var hs-var">multiline</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826335"><span class="hs-identifier hs-var">row</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanEndLine"><span class="hs-identifier hs-var">srcSpanEndLine</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span>    </span><span id="local-6989586621680826339"><span class="annot"><span class="annottext">caretDiagnostic :: Maybe FilePath -&gt; MsgDoc
</span><a href="#local-6989586621680826339"><span class="hs-identifier hs-var hs-var">caretDiagnostic</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-283"></span><span>    </span><span class="annot"><a href="#local-6989586621680826339"><span class="hs-identifier hs-var">caretDiagnostic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826309"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826309"><span class="hs-identifier hs-var">srcLineWithNewline</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-284"></span><span>      </span><span class="annot"><span class="annottext">(SDocContext -&gt; Scheme) -&gt; (Scheme -&gt; MsgDoc) -&gt; MsgDoc
forall a. (SDocContext -&gt; a) -&gt; (a -&gt; MsgDoc) -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sdocOption"><span class="hs-identifier hs-var">sdocOption</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; Scheme
</span><a href="GHC.Utils.Outputable.html#sdocColScheme"><span class="hs-identifier hs-var hs-var">sdocColScheme</span></a></span><span class="annot"><span class="annottext">((Scheme -&gt; MsgDoc) -&gt; MsgDoc) -&gt; (Scheme -&gt; MsgDoc) -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680826308"><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826308"><span class="hs-identifier hs-var">col_scheme</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-285"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826307"><span class="annot"><span class="annottext">sevColour :: PprColour
</span><a href="#local-6989586621680826307"><span class="hs-identifier hs-var hs-var">sevColour</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity -&gt; Scheme -&gt; PprColour
</span><a href="GHC.Utils.Error.html#getSeverityColour"><span class="hs-identifier hs-var">getSeverityColour</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826342"><span class="hs-identifier hs-var">severity</span></a></span><span> </span><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826308"><span class="hs-identifier hs-var">col_scheme</span></a></span><span>
</span><span id="line-286"></span><span>          </span><span id="local-6989586621680826306"><span class="annot"><span class="annottext">marginColour :: PprColour
</span><a href="#local-6989586621680826306"><span class="hs-identifier hs-var hs-var">marginColour</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Scheme -&gt; PprColour
</span><a href="GHC.Utils.Ppr.Colour.html#sMargin"><span class="hs-identifier hs-var hs-var">Col.sMargin</span></a></span><span> </span><span class="annot"><span class="annottext">Scheme
</span><a href="#local-6989586621680826308"><span class="hs-identifier hs-var">col_scheme</span></a></span><span>
</span><span id="line-287"></span><span>      </span><span class="hs-keyword">in</span><span>
</span><span id="line-288"></span><span>      </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826306"><span class="hs-identifier hs-var">marginColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826304"><span class="hs-identifier hs-var">marginSpace</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-289"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\n&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-290"></span><span>      </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826306"><span class="hs-identifier hs-var">marginColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826303"><span class="hs-identifier hs-var">marginRow</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-291"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826302"><span class="hs-identifier hs-var">srcLinePre</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-292"></span><span>      </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826307"><span class="hs-identifier hs-var">sevColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826301"><span class="hs-identifier hs-var">srcLineSpan</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-293"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826300"><span class="hs-identifier hs-var">srcLinePost</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\n&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-294"></span><span>      </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826306"><span class="hs-identifier hs-var">marginColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826304"><span class="hs-identifier hs-var">marginSpace</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-295"></span><span>      </span><span class="annot"><span class="annottext">PprColour -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#coloured"><span class="hs-identifier hs-var">coloured</span></a></span><span> </span><span class="annot"><span class="annottext">PprColour
</span><a href="#local-6989586621680826307"><span class="hs-identifier hs-var">sevColour</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826299"><span class="hs-identifier hs-var">caretLine</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span>        </span><span class="hs-comment">-- expand tabs in a device-independent manner #13664</span><span>
</span><span id="line-300"></span><span>        </span><span id="local-6989586621680826295"><span class="annot"><span class="annottext">expandTabs :: Int -&gt; Int -&gt; ShowS
</span><a href="#local-6989586621680826295"><span class="hs-identifier hs-var hs-var">expandTabs</span></a></span></span><span> </span><span id="local-6989586621680826294"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826294"><span class="hs-identifier hs-var">tabWidth</span></a></span></span><span> </span><span id="local-6989586621680826293"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826293"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621680826292"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826292"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-301"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826292"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-302"></span><span>            </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-303"></span><span>            </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\t'</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680826291"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826291"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826289"><span class="hs-identifier hs-var">effectiveWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-304"></span><span>                         </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ShowS
</span><a href="#local-6989586621680826295"><span class="hs-identifier hs-var">expandTabs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826294"><span class="hs-identifier hs-var">tabWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826293"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826289"><span class="hs-identifier hs-var">effectiveWidth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826291"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-305"></span><span>            </span><span id="local-6989586621680826287"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826287"><span class="hs-identifier hs-var">c</span></a></span></span><span>    </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680826286"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826286"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826287"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ShowS
</span><a href="#local-6989586621680826295"><span class="hs-identifier hs-var">expandTabs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826294"><span class="hs-identifier hs-var">tabWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826293"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826286"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-306"></span><span>          </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680826289"><span class="annot"><span class="annottext">effectiveWidth :: Int
</span><a href="#local-6989586621680826289"><span class="hs-identifier hs-var hs-var">effectiveWidth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826294"><span class="hs-identifier hs-var">tabWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826293"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-operator hs-var">`mod`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826294"><span class="hs-identifier hs-var">tabWidth</span></a></span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span>        </span><span id="local-6989586621680826279"><span class="annot"><span class="annottext">srcLine :: FilePath
</span><a href="#local-6989586621680826279"><span class="hs-identifier hs-var hs-var">srcLine</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ShowS
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ShowS
</span><a href="#local-6989586621680826295"><span class="hs-identifier hs-var">expandTabs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826309"><span class="hs-identifier hs-var">srcLineWithNewline</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span>        </span><span id="local-6989586621680826276"><span class="annot"><span class="annottext">start :: Int
</span><a href="#local-6989586621680826276"><span class="hs-identifier hs-var hs-var">start</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanStartCol"><span class="hs-identifier hs-var">srcSpanStartCol</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-311"></span><span>        </span><span id="local-6989586621680826271"><span class="annot"><span class="annottext">end :: Int
</span><a href="#local-6989586621680826271"><span class="hs-identifier hs-var hs-var">end</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826312"><span class="hs-identifier hs-var">multiline</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826279"><span class="hs-identifier hs-var">srcLine</span></a></span><span>
</span><span id="line-312"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanEndCol"><span class="hs-identifier hs-var">srcSpanEndCol</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621680826340"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-313"></span><span>        </span><span id="local-6989586621680826265"><span class="annot"><span class="annottext">width :: Int
</span><a href="#local-6989586621680826265"><span class="hs-identifier hs-var hs-var">width</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826271"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826276"><span class="hs-identifier hs-var">start</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span>        </span><span id="local-6989586621680826262"><span class="annot"><span class="annottext">marginWidth :: Int
</span><a href="#local-6989586621680826262"><span class="hs-identifier hs-var hs-var">marginWidth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826314"><span class="hs-identifier hs-var">rowStr</span></a></span><span>
</span><span id="line-316"></span><span>        </span><span id="local-6989586621680826304"><span class="annot"><span class="annottext">marginSpace :: FilePath
</span><a href="#local-6989586621680826304"><span class="hs-identifier hs-var hs-var">marginSpace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826262"><span class="hs-identifier hs-var">marginWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; |&quot;</span></span><span>
</span><span id="line-317"></span><span>        </span><span id="local-6989586621680826303"><span class="annot"><span class="annottext">marginRow :: FilePath
</span><a href="#local-6989586621680826303"><span class="hs-identifier hs-var hs-var">marginRow</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826314"><span class="hs-identifier hs-var">rowStr</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; |&quot;</span></span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621680826302"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826302"><span class="hs-identifier hs-var">srcLinePre</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621680826261"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826261"><span class="hs-identifier hs-var">srcLineRest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; (FilePath, FilePath)
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826276"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826279"><span class="hs-identifier hs-var">srcLine</span></a></span><span>
</span><span id="line-320"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621680826301"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826301"><span class="hs-identifier hs-var">srcLineSpan</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826300"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826300"><span class="hs-identifier hs-var">srcLinePost</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; (FilePath, FilePath)
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826265"><span class="hs-identifier hs-var">width</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826261"><span class="hs-identifier hs-var">srcLineRest</span></a></span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span>        </span><span id="local-6989586621680826259"><span class="annot"><span class="annottext">caretEllipsis :: FilePath
</span><a href="#local-6989586621680826259"><span class="hs-identifier hs-var hs-var">caretEllipsis</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826312"><span class="hs-identifier hs-var">multiline</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;...&quot;</span></span><span>
</span><span id="line-323"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-324"></span><span>        </span><span id="local-6989586621680826299"><span class="annot"><span class="annottext">caretLine :: FilePath
</span><a href="#local-6989586621680826299"><span class="hs-identifier hs-var hs-var">caretLine</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826276"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826265"><span class="hs-identifier hs-var">width</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'^'</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826259"><span class="hs-identifier hs-var">caretEllipsis</span></a></span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="annot"><a href="GHC.Utils.Error.html#makeIntoWarning"><span class="hs-identifier hs-type">makeIntoWarning</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarnReason"><span class="hs-identifier hs-type">WarnReason</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-327"></span><span id="makeIntoWarning"><span class="annot"><span class="annottext">makeIntoWarning :: WarnReason -&gt; ErrMsg -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#makeIntoWarning"><span class="hs-identifier hs-var hs-var">makeIntoWarning</span></a></span></span><span> </span><span id="local-6989586621680826258"><span class="annot"><span class="annottext">WarnReason
</span><a href="#local-6989586621680826258"><span class="hs-identifier hs-var">reason</span></a></span></span><span> </span><span id="local-6989586621680826257"><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826257"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826257"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">errMsgSeverity :: Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var">errMsgSeverity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgReason :: WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var">errMsgReason</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="#local-6989586621680826258"><span class="hs-identifier hs-var">reason</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-332"></span><span class="hs-comment">-- Collecting up messages for later ordering and printing.</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="annot"><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-type">mk_err_msg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Severity"><span class="hs-identifier hs-type">Severity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-335"></span><span id="mk_err_msg"><span class="annot"><span class="annottext">mk_err_msg :: DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var hs-var">mk_err_msg</span></a></span></span><span> </span><span id="local-6989586621680826255"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826255"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826254"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826254"><span class="hs-identifier hs-var">sev</span></a></span></span><span> </span><span id="local-6989586621680826253"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826253"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826252"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826252"><span class="hs-identifier hs-var">print_unqual</span></a></span></span><span> </span><span id="local-6989586621680826251"><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826251"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-336"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrMsg :: SrcSpan
-&gt; PrintUnqualified
-&gt; ErrDoc
-&gt; FilePath
-&gt; Severity
-&gt; WarnReason
-&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">errMsgSpan :: SrcSpan
</span><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier hs-var">errMsgSpan</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826253"><span class="hs-identifier hs-var">locn</span></a></span><span>
</span><span id="line-337"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgContext :: PrintUnqualified
</span><a href="GHC.Utils.Error.html#errMsgContext"><span class="hs-identifier hs-var">errMsgContext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826252"><span class="hs-identifier hs-var">print_unqual</span></a></span><span>
</span><span id="line-338"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgDoc :: ErrDoc
</span><a href="GHC.Utils.Error.html#errMsgDoc"><span class="hs-identifier hs-var">errMsgDoc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826251"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-339"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgShortString :: FilePath
</span><a href="GHC.Utils.Error.html#errMsgShortString"><span class="hs-identifier hs-var">errMsgShortString</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826255"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ErrDoc -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#errDocImportant"><span class="hs-identifier hs-var hs-var">errDocImportant</span></a></span><span> </span><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826251"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgSeverity :: Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var">errMsgSeverity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826254"><span class="hs-identifier hs-var">sev</span></a></span><span>
</span><span id="line-341"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgReason :: WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var">errMsgReason</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span class="annot"><a href="GHC.Utils.Error.html#mkErrDoc"><span class="hs-identifier hs-type">mkErrDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-344"></span><span id="mkErrDoc"><span class="annot"><span class="annottext">mkErrDoc :: DynFlags -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkErrDoc"><span class="hs-identifier hs-var hs-var">mkErrDoc</span></a></span></span><span> </span><span id="local-6989586621680826248"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826248"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826248"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span class="annot"><a href="GHC.Utils.Error.html#mkLongErrMsg"><span class="hs-identifier hs-type">mkLongErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkLongWarnMsg"><span class="hs-identifier hs-type">mkLongWarnMsg</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-347"></span><span class="hs-comment">-- ^ A long (multi-line) error message</span><span>
</span><span id="line-348"></span><span class="annot"><a href="GHC.Utils.Error.html#mkErrMsg"><span class="hs-identifier hs-type">mkErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkWarnMsg"><span class="hs-identifier hs-type">mkWarnMsg</span></a></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-349"></span><span class="hs-comment">-- ^ A short (one-line) error message</span><span>
</span><span id="line-350"></span><span class="annot"><a href="GHC.Utils.Error.html#mkPlainErrMsg"><span class="hs-identifier hs-type">mkPlainErrMsg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#mkPlainWarnMsg"><span class="hs-identifier hs-type">mkPlainWarnMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>                     </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span>
</span><span id="line-351"></span><span class="hs-comment">-- ^ Variant that doesn't care about qualified/unqualified names</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span id="mkLongErrMsg"><span class="annot"><span class="annottext">mkLongErrMsg :: DynFlags
-&gt; SrcSpan -&gt; PrintUnqualified -&gt; MsgDoc -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkLongErrMsg"><span class="hs-identifier hs-var hs-var">mkLongErrMsg</span></a></span></span><span>   </span><span id="local-6989586621680826247"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826247"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826246"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826246"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826245"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826245"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span id="local-6989586621680826244"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826244"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621680826243"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826243"><span class="hs-identifier hs-var">extra</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826247"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>   </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826246"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826245"><span class="hs-identifier hs-var">unqual</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826244"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826243"><span class="hs-identifier hs-var">extra</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span id="mkErrMsg"><span class="annot"><span class="annottext">mkErrMsg :: DynFlags -&gt; SrcSpan -&gt; PrintUnqualified -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkErrMsg"><span class="hs-identifier hs-var hs-var">mkErrMsg</span></a></span></span><span>       </span><span id="local-6989586621680826242"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826242"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826241"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826241"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826240"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826240"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span id="local-6989586621680826239"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826239"><span class="hs-identifier hs-var">msg</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826242"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>   </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826241"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826240"><span class="hs-identifier hs-var">unqual</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826239"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span id="mkPlainErrMsg"><span class="annot"><span class="annottext">mkPlainErrMsg :: DynFlags -&gt; SrcSpan -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkPlainErrMsg"><span class="hs-identifier hs-var hs-var">mkPlainErrMsg</span></a></span></span><span>  </span><span id="local-6989586621680826238"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826238"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826237"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826237"><span class="hs-identifier hs-var">locn</span></a></span></span><span>        </span><span id="local-6989586621680826236"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826236"><span class="hs-identifier hs-var">msg</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826238"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>   </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826237"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier hs-var">alwaysQualify</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826236"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span id="mkLongWarnMsg"><span class="annot"><span class="annottext">mkLongWarnMsg :: DynFlags
-&gt; SrcSpan -&gt; PrintUnqualified -&gt; MsgDoc -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkLongWarnMsg"><span class="hs-identifier hs-var hs-var">mkLongWarnMsg</span></a></span></span><span>  </span><span id="local-6989586621680826234"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826234"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826233"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826233"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826232"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826232"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span id="local-6989586621680826231"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826231"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621680826230"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826230"><span class="hs-identifier hs-var">extra</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826234"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826233"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826232"><span class="hs-identifier hs-var">unqual</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826231"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826230"><span class="hs-identifier hs-var">extra</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span id="mkWarnMsg"><span class="annot"><span class="annottext">mkWarnMsg :: DynFlags -&gt; SrcSpan -&gt; PrintUnqualified -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkWarnMsg"><span class="hs-identifier hs-var hs-var">mkWarnMsg</span></a></span></span><span>      </span><span id="local-6989586621680826229"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826229"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826228"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826228"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span id="local-6989586621680826227"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826227"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span id="local-6989586621680826226"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826226"><span class="hs-identifier hs-var">msg</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826229"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826228"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826227"><span class="hs-identifier hs-var">unqual</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826226"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-358"></span><span id="mkPlainWarnMsg"><span class="annot"><span class="annottext">mkPlainWarnMsg :: DynFlags -&gt; SrcSpan -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkPlainWarnMsg"><span class="hs-identifier hs-var hs-var">mkPlainWarnMsg</span></a></span></span><span> </span><span id="local-6989586621680826225"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826225"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826224"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826224"><span class="hs-identifier hs-var">locn</span></a></span></span><span>        </span><span id="local-6989586621680826223"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826223"><span class="hs-identifier hs-var">msg</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Severity -&gt; SrcSpan -&gt; PrintUnqualified -&gt; ErrDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mk_err_msg"><span class="hs-identifier hs-var">mk_err_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826225"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826224"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier hs-var">alwaysQualify</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; [MsgDoc] -&gt; [MsgDoc] -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-var">ErrDoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826223"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-361"></span><span class="annot"><a href="GHC.Utils.Error.html#emptyMessages"><span class="hs-identifier hs-type">emptyMessages</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span>
</span><span id="line-362"></span><span id="emptyMessages"><span class="annot"><span class="annottext">emptyMessages :: Messages
</span><a href="GHC.Utils.Error.html#emptyMessages"><span class="hs-identifier hs-var hs-var">emptyMessages</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningMessages
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">WarningMessages
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="annot"><a href="GHC.Utils.Error.html#isEmptyMessages"><span class="hs-identifier hs-type">isEmptyMessages</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-365"></span><span id="isEmptyMessages"><span class="annot"><span class="annottext">isEmptyMessages :: Messages -&gt; Bool
</span><a href="GHC.Utils.Error.html#isEmptyMessages"><span class="hs-identifier hs-var hs-var">isEmptyMessages</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826221"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826221"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826220"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826220"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningMessages -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826221"><span class="hs-identifier hs-var">warns</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">WarningMessages -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826220"><span class="hs-identifier hs-var">errs</span></a></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="annot"><a href="GHC.Utils.Error.html#errorsFound"><span class="hs-identifier hs-type">errorsFound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-368"></span><span id="errorsFound"><span class="annot"><span class="annottext">errorsFound :: DynFlags -&gt; Messages -&gt; Bool
</span><a href="GHC.Utils.Error.html#errorsFound"><span class="hs-identifier hs-var hs-var">errorsFound</span></a></span></span><span> </span><span id="local-6989586621680826217"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826217"><span class="hs-identifier hs-var">_dflags</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826216"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826216"><span class="hs-identifier hs-var">_warns</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826215"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826215"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningMessages -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826215"><span class="hs-identifier hs-var">errs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="annot"><a href="GHC.Utils.Error.html#warningsToMessages"><span class="hs-identifier hs-type">warningsToMessages</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#WarningMessages"><span class="hs-identifier hs-type">WarningMessages</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#Messages"><span class="hs-identifier hs-type">Messages</span></a></span><span>
</span><span id="line-371"></span><span id="warningsToMessages"><span class="annot"><span class="annottext">warningsToMessages :: DynFlags -&gt; WarningMessages -&gt; Messages
</span><a href="GHC.Utils.Error.html#warningsToMessages"><span class="hs-identifier hs-var hs-var">warningsToMessages</span></a></span></span><span> </span><span id="local-6989586621680826213"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826213"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-372"></span><span>  </span><span class="annot"><span class="annottext">(ErrMsg -&gt; Either ErrMsg ErrMsg) -&gt; WarningMessages -&gt; Messages
forall a b c. (a -&gt; Either b c) -&gt; Bag a -&gt; (Bag b, Bag c)
</span><a href="GHC.Data.Bag.html#partitionBagWith"><span class="hs-identifier hs-var">partitionBagWith</span></a></span><span> </span><span class="annot"><span class="annottext">((ErrMsg -&gt; Either ErrMsg ErrMsg) -&gt; WarningMessages -&gt; Messages)
-&gt; (ErrMsg -&gt; Either ErrMsg ErrMsg) -&gt; WarningMessages -&gt; Messages
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680826211"><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826211"><span class="hs-identifier hs-var">warn</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-373"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ErrMsg -&gt; Maybe (Maybe WarningFlag)
</span><a href="GHC.Utils.Error.html#isWarnMsgFatal"><span class="hs-identifier hs-var">isWarnMsgFatal</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826213"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826211"><span class="hs-identifier hs-var">warn</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-374"></span><span>      </span><span class="annot"><span class="annottext">Maybe (Maybe WarningFlag)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; Either ErrMsg ErrMsg
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826211"><span class="hs-identifier hs-var">warn</span></a></span><span>
</span><span id="line-375"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826210"><span class="annot"><span class="annottext">Maybe WarningFlag
</span><a href="#local-6989586621680826210"><span class="hs-identifier hs-var">err_reason</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-376"></span><span>        </span><span class="annot"><span class="annottext">ErrMsg -&gt; Either ErrMsg ErrMsg
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826211"><span class="hs-identifier hs-var">warn</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">errMsgSeverity :: Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var">errMsgSeverity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span>
</span><span id="line-377"></span><span>                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgReason :: WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var">errMsgReason</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#ErrReason"><span class="hs-identifier hs-var">ErrReason</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe WarningFlag
</span><a href="#local-6989586621680826210"><span class="hs-identifier hs-var">err_reason</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="annot"><a href="GHC.Utils.Error.html#printBagOfErrors"><span class="hs-identifier hs-type">printBagOfErrors</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span id="printBagOfErrors"><span class="annot"><span class="annottext">printBagOfErrors :: DynFlags -&gt; WarningMessages -&gt; IO ()
</span><a href="GHC.Utils.Error.html#printBagOfErrors"><span class="hs-identifier hs-var hs-var">printBagOfErrors</span></a></span></span><span> </span><span id="local-6989586621680826208"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826208"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826207"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826207"><span class="hs-identifier hs-var">bag_of_errors</span></a></span></span><span>
</span><span id="line-381"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[IO ()] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826205"><span class="annot"><span class="annottext">style :: PprStyle
</span><a href="#local-6989586621680826205"><span class="hs-identifier hs-var hs-var">style</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrintUnqualified -&gt; PprStyle
</span><a href="GHC.Utils.Outputable.html#mkErrStyle"><span class="hs-identifier hs-var">mkErrStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826203"><span class="hs-identifier hs-var">unqual</span></a></span><span>
</span><span id="line-382"></span><span>                    </span><span id="local-6989586621680826202"><span class="annot"><span class="annottext">ctx :: SDocContext
</span><a href="#local-6989586621680826202"><span class="hs-identifier hs-var hs-var">ctx</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; PprStyle -&gt; SDocContext
</span><a href="GHC.Driver.Session.html#initSDocContext"><span class="hs-identifier hs-var">initSDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826208"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826205"><span class="hs-identifier hs-var">style</span></a></span><span>
</span><span id="line-383"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826208"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="#local-6989586621680826199"><span class="hs-identifier hs-var">reason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826198"><span class="hs-identifier hs-var">sev</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826197"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826205"><span class="hs-identifier hs-var">style</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; ErrDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#formatErrDoc"><span class="hs-identifier hs-var">formatErrDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680826202"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826195"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-384"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">errMsgSpan :: ErrMsg -&gt; SrcSpan
</span><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier hs-var">errMsgSpan</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826197"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826197"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-385"></span><span>                         </span><span class="annot"><span class="annottext">errMsgDoc :: ErrMsg -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#errMsgDoc"><span class="hs-identifier hs-var">errMsgDoc</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826195"><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826195"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-386"></span><span>                         </span><span class="annot"><span class="annottext">errMsgSeverity :: ErrMsg -&gt; Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var">errMsgSeverity</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826198"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826198"><span class="hs-identifier hs-var">sev</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-387"></span><span>                         </span><span class="annot"><span class="annottext">errMsgReason :: ErrMsg -&gt; WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var">errMsgReason</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826199"><span class="annot"><span class="annottext">WarnReason
</span><a href="#local-6989586621680826199"><span class="hs-identifier hs-var">reason</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-388"></span><span>                         </span><span class="annot"><span class="annottext">errMsgContext :: ErrMsg -&gt; PrintUnqualified
</span><a href="GHC.Utils.Error.html#errMsgContext"><span class="hs-identifier hs-var">errMsgContext</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826203"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826203"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe DynFlags -&gt; WarningMessages -&gt; [ErrMsg]
</span><a href="GHC.Utils.Error.html#sortMsgBag"><span class="hs-identifier hs-var">sortMsgBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe DynFlags
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826208"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>                                                                  </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826207"><span class="hs-identifier hs-var">bag_of_errors</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span class="annot"><a href="GHC.Utils.Error.html#formatErrDoc"><span class="hs-identifier hs-type">formatErrDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDocContext"><span class="hs-identifier hs-type">SDocContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-392"></span><span id="formatErrDoc"><span class="annot"><span class="annottext">formatErrDoc :: SDocContext -&gt; ErrDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#formatErrDoc"><span class="hs-identifier hs-var hs-var">formatErrDoc</span></a></span></span><span> </span><span id="local-6989586621680826193"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680826193"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#ErrDoc"><span class="hs-identifier hs-type">ErrDoc</span></a></span><span> </span><span id="local-6989586621680826192"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826192"><span class="hs-identifier hs-var">important</span></a></span></span><span> </span><span id="local-6989586621680826191"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826191"><span class="hs-identifier hs-var">context</span></a></span></span><span> </span><span id="local-6989586621680826190"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826190"><span class="hs-identifier hs-var">supplementary</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-393"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[[MsgDoc]]
</span><a href="#local-6989586621680826189"><span class="hs-identifier hs-var">msgs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-394"></span><span>        </span><span class="hs-special">[</span><span id="local-6989586621680826188"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826188"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826188"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-395"></span><span>        </span><span class="annot"><span class="annottext">[[MsgDoc]]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">([MsgDoc] -&gt; MsgDoc) -&gt; [MsgDoc] -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([MsgDoc] -&gt; MsgDoc) -&gt; [[MsgDoc]] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="#local-6989586621680826187"><span class="hs-identifier hs-var">starred</span></a></span><span> </span><span class="annot"><span class="annottext">[[MsgDoc]]
</span><a href="#local-6989586621680826189"><span class="hs-identifier hs-var">msgs</span></a></span><span>
</span><span id="line-396"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-397"></span><span>    </span><span id="local-6989586621680826189"><span class="annot"><span class="annottext">msgs :: [[MsgDoc]]
</span><a href="#local-6989586621680826189"><span class="hs-identifier hs-var hs-var">msgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([MsgDoc] -&gt; Bool) -&gt; [[MsgDoc]] -&gt; [[MsgDoc]]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; ([MsgDoc] -&gt; Bool) -&gt; [MsgDoc] -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([[MsgDoc]] -&gt; [[MsgDoc]]) -&gt; [[MsgDoc]] -&gt; [[MsgDoc]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([MsgDoc] -&gt; [MsgDoc]) -&gt; [[MsgDoc]] -&gt; [[MsgDoc]]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MsgDoc -&gt; Bool) -&gt; [MsgDoc] -&gt; [MsgDoc]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (MsgDoc -&gt; Bool) -&gt; MsgDoc -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; Bool
</span><a href="GHC.Utils.Outputable.html#isEmpty"><span class="hs-identifier hs-var">Outputable.isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680826193"><span class="hs-identifier hs-var">ctx</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-398"></span><span>        </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826192"><span class="hs-identifier hs-var">important</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826191"><span class="hs-identifier hs-var">context</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621680826190"><span class="hs-identifier hs-var">supplementary</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-399"></span><span>    </span><span id="local-6989586621680826187"><span class="annot"><span class="annottext">starred :: [MsgDoc] -&gt; MsgDoc
</span><a href="#local-6989586621680826187"><span class="hs-identifier hs-var hs-var">starred</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#bullet"><span class="hs-identifier hs-var">bullet</span></a></span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; ([MsgDoc] -&gt; MsgDoc) -&gt; [MsgDoc] -&gt; MsgDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span class="annot"><a href="GHC.Utils.Error.html#pprErrMsgBagWithLoc"><span class="hs-identifier hs-type">pprErrMsgBagWithLoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-402"></span><span id="pprErrMsgBagWithLoc"><span class="annot"><span class="annottext">pprErrMsgBagWithLoc :: WarningMessages -&gt; [MsgDoc]
</span><a href="GHC.Utils.Error.html#pprErrMsgBagWithLoc"><span class="hs-identifier hs-var hs-var">pprErrMsgBagWithLoc</span></a></span></span><span> </span><span id="local-6989586621680826181"><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826181"><span class="hs-identifier hs-var">bag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#pprLocErrMsg"><span class="hs-identifier hs-var">pprLocErrMsg</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826180"><span class="hs-identifier hs-var">item</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621680826180"><span class="annot"><span class="annottext">ErrMsg
</span><a href="#local-6989586621680826180"><span class="hs-identifier hs-var">item</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe DynFlags -&gt; WarningMessages -&gt; [ErrMsg]
</span><a href="GHC.Utils.Error.html#sortMsgBag"><span class="hs-identifier hs-var">sortMsgBag</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe DynFlags
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages
</span><a href="#local-6989586621680826181"><span class="hs-identifier hs-var">bag</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span class="annot"><a href="GHC.Utils.Error.html#pprLocErrMsg"><span class="hs-identifier hs-type">pprLocErrMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-405"></span><span id="pprLocErrMsg"><span class="annot"><span class="annottext">pprLocErrMsg :: ErrMsg -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#pprLocErrMsg"><span class="hs-identifier hs-var hs-var">pprLocErrMsg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">errMsgSpan :: ErrMsg -&gt; SrcSpan
</span><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier hs-var">errMsgSpan</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826179"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826179"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-406"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgDoc :: ErrMsg -&gt; ErrDoc
</span><a href="GHC.Utils.Error.html#errMsgDoc"><span class="hs-identifier hs-var">errMsgDoc</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826178"><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826178"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-407"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgSeverity :: ErrMsg -&gt; Severity
</span><a href="GHC.Utils.Error.html#errMsgSeverity"><span class="hs-identifier hs-var">errMsgSeverity</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826177"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826177"><span class="hs-identifier hs-var">sev</span></a></span></span><span>
</span><span id="line-408"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">errMsgContext :: ErrMsg -&gt; PrintUnqualified
</span><a href="GHC.Utils.Error.html#errMsgContext"><span class="hs-identifier hs-var">errMsgContext</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680826176"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826176"><span class="hs-identifier hs-var">unqual</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SDocContext -&gt; MsgDoc) -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sdocWithContext"><span class="hs-identifier hs-var">sdocWithContext</span></a></span><span> </span><span class="annot"><span class="annottext">((SDocContext -&gt; MsgDoc) -&gt; MsgDoc)
-&gt; (SDocContext -&gt; MsgDoc) -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680826174"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680826174"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-410"></span><span>    </span><span class="annot"><span class="annottext">PrintUnqualified -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withErrStyle"><span class="hs-identifier hs-var">withErrStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826176"><span class="hs-identifier hs-var">unqual</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkLocMessage"><span class="hs-identifier hs-var">mkLocMessage</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826177"><span class="hs-identifier hs-var">sev</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621680826179"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; ErrDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#formatErrDoc"><span class="hs-identifier hs-var">formatErrDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680826174"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">ErrDoc
</span><a href="#local-6989586621680826178"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="annot"><a href="GHC.Utils.Error.html#sortMsgBag"><span class="hs-identifier hs-type">sortMsgBag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-413"></span><span id="sortMsgBag"><span class="annot"><span class="annottext">sortMsgBag :: Maybe DynFlags -&gt; WarningMessages -&gt; [ErrMsg]
</span><a href="GHC.Utils.Error.html#sortMsgBag"><span class="hs-identifier hs-var hs-var">sortMsgBag</span></a></span></span><span> </span><span id="local-6989586621680826172"><span class="annot"><span class="annottext">Maybe DynFlags
</span><a href="#local-6989586621680826172"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ErrMsg] -&gt; [ErrMsg]
forall {a}. [a] -&gt; [a]
</span><a href="#local-6989586621680826171"><span class="hs-identifier hs-var">maybeLimit</span></a></span><span> </span><span class="annot"><span class="annottext">([ErrMsg] -&gt; [ErrMsg])
-&gt; (WarningMessages -&gt; [ErrMsg]) -&gt; WarningMessages -&gt; [ErrMsg]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrMsg -&gt; ErrMsg -&gt; Ordering) -&gt; [ErrMsg] -&gt; [ErrMsg]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="#local-6989586621680826169"><span class="hs-identifier hs-var">cmp</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; Ordering)
-&gt; (ErrMsg -&gt; SrcSpan) -&gt; ErrMsg -&gt; ErrMsg -&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; SrcSpan
</span><a href="GHC.Utils.Error.html#errMsgSpan"><span class="hs-identifier hs-var hs-var">errMsgSpan</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([ErrMsg] -&gt; [ErrMsg])
-&gt; (WarningMessages -&gt; [ErrMsg]) -&gt; WarningMessages -&gt; [ErrMsg]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WarningMessages -&gt; [ErrMsg]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span>
</span><span id="line-414"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680826169"><span class="annot"><span class="annottext">cmp :: SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="#local-6989586621680826169"><span class="hs-identifier hs-var hs-var">cmp</span></a></span></span><span>
</span><span id="line-415"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool -&gt; Bool
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Bool) -&gt; Maybe DynFlags -&gt; Maybe Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#reverseErrors"><span class="hs-identifier hs-var hs-var">reverseErrors</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe DynFlags
</span><a href="#local-6989586621680826172"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#rightmost_smallest"><span class="hs-identifier hs-var">SrcLoc.rightmost_smallest</span></a></span><span>
</span><span id="line-416"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span>
</span><span id="line-417"></span><span>        </span><span id="local-6989586621680826171"><span class="annot"><span class="annottext">maybeLimit :: [a] -&gt; [a]
</span><a href="#local-6989586621680826171"><span class="hs-identifier hs-var hs-var">maybeLimit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe Int) -&gt; Maybe Int
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe Int) -&gt; Maybe DynFlags -&gt; Maybe (Maybe Int)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe Int
</span><a href="GHC.Driver.Session.html#maxErrors"><span class="hs-identifier hs-var hs-var">maxErrors</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe DynFlags
</span><a href="#local-6989586621680826172"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-418"></span><span>          </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-419"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826157"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826157"><span class="hs-identifier hs-var">err_limit</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; [a]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826157"><span class="hs-identifier hs-var">err_limit</span></a></span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="annot"><a href="GHC.Utils.Error.html#ghcExit"><span class="hs-identifier hs-type">ghcExit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span id="ghcExit"><span class="annot"><span class="annottext">ghcExit :: DynFlags -&gt; Int -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ghcExit"><span class="hs-identifier hs-var hs-var">ghcExit</span></a></span></span><span> </span><span id="local-6989586621680826155"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826155"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826154"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826154"><span class="hs-identifier hs-var">val</span></a></span></span><span>
</span><span id="line-423"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826154"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#errorMsg"><span class="hs-identifier hs-var">errorMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826155"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\nCompilation had errors\n\n&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-425"></span><span>                   </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826154"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span class="annot"><a href="GHC.Utils.Error.html#doIfSet"><span class="hs-identifier hs-type">doIfSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-428"></span><span id="doIfSet"><span class="annot"><span class="annottext">doIfSet :: Bool -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#doIfSet"><span class="hs-identifier hs-var hs-var">doIfSet</span></a></span></span><span> </span><span id="local-6989586621680826151"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826151"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621680826150"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826150"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826151"><span class="hs-identifier hs-var">flag</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826150"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-429"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="annot"><a href="GHC.Utils.Error.html#doIfSet_dyn"><span class="hs-identifier hs-type">doIfSet_dyn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#GeneralFlag"><span class="hs-identifier hs-type">GeneralFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span id="doIfSet_dyn"><span class="annot"><span class="annottext">doIfSet_dyn :: DynFlags -&gt; GeneralFlag -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#doIfSet_dyn"><span class="hs-identifier hs-var hs-var">doIfSet_dyn</span></a></span></span><span> </span><span id="local-6989586621680826149"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826149"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826148"><span class="annot"><span class="annottext">GeneralFlag
</span><a href="#local-6989586621680826148"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621680826147"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826147"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="#local-6989586621680826148"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826149"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826147"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-433"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-436"></span><span class="hs-comment">-- Dumping</span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier hs-type">dumpIfSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span id="dumpIfSet"><span class="annot"><span class="annottext">dumpIfSet :: DynFlags -&gt; Bool -&gt; FilePath -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier hs-var hs-var">dumpIfSet</span></a></span></span><span> </span><span id="local-6989586621680826145"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826145"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826144"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826144"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621680826143"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826143"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span id="local-6989586621680826142"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826142"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-440"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826144"><span class="hs-identifier hs-var">flag</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-441"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#doDump"><span class="hs-identifier hs-var">doDump</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826145"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826143"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826142"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-442"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-pragma hs-type">dumpIfSet</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- see Note [INLINE conditional tracing utilities]</span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span class="hs-comment">-- | This is a helper for 'dumpIfSet' to ensure that it's not duplicated</span><span>
</span><span id="line-445"></span><span class="hs-comment">-- despite the fact that 'dumpIfSet' has an @INLINE@.</span><span>
</span><span id="line-446"></span><span class="annot"><a href="GHC.Utils.Error.html#doDump"><span class="hs-identifier hs-type">doDump</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span id="doDump"><span class="annot"><span class="annottext">doDump :: DynFlags -&gt; FilePath -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#doDump"><span class="hs-identifier hs-var hs-var">doDump</span></a></span></span><span> </span><span id="local-6989586621680826140"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826140"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826139"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826139"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span id="local-6989586621680826138"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826138"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-448"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826140"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-449"></span><span>            </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span>
</span><span id="line-450"></span><span>            </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevDump"><span class="hs-identifier hs-var">SevDump</span></a></span><span>
</span><span id="line-451"></span><span>            </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-452"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultDumpStyle"><span class="hs-identifier hs-var">defaultDumpStyle</span></a></span><span>
</span><span id="line-453"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkDumpDoc"><span class="hs-identifier hs-var">mkDumpDoc</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826139"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826138"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span class="hs-comment">-- | A wrapper around 'dumpAction'.</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- First check whether the dump flag is set</span><span>
</span><span id="line-457"></span><span class="hs-comment">-- Do nothing if it is unset</span><span>
</span><span id="line-458"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-type">dumpIfSet_dyn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#DumpFlag"><span class="hs-identifier hs-type">DumpFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier hs-type">DumpFormat</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span id="dumpIfSet_dyn"><span class="annot"><span class="annottext">dumpIfSet_dyn :: DynFlags -&gt; DumpFlag -&gt; FilePath -&gt; DumpFormat -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var hs-var">dumpIfSet_dyn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
-&gt; DynFlags
-&gt; DumpFlag
-&gt; FilePath
-&gt; DumpFormat
-&gt; MsgDoc
-&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier hs-var">dumpIfSet_dyn_printer</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier hs-var">alwaysQualify</span></a></span><span>
</span><span id="line-460"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-pragma hs-type">dumpIfSet_dyn</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- see Note [INLINE conditional tracing utilities]</span><span>
</span><span id="line-461"></span><span>
</span><span id="line-462"></span><span class="hs-comment">-- | A wrapper around 'dumpAction'.</span><span>
</span><span id="line-463"></span><span class="hs-comment">-- First check whether the dump flag is set</span><span>
</span><span id="line-464"></span><span class="hs-comment">-- Do nothing if it is unset</span><span>
</span><span id="line-465"></span><span class="hs-comment">--</span><span>
</span><span id="line-466"></span><span class="hs-comment">-- Unlike 'dumpIfSet_dyn', has a printer argument</span><span>
</span><span id="line-467"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier hs-type">dumpIfSet_dyn_printer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#DumpFlag"><span class="hs-identifier hs-type">DumpFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-468"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier hs-type">DumpFormat</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span id="dumpIfSet_dyn_printer"><span class="annot"><span class="annottext">dumpIfSet_dyn_printer :: PrintUnqualified
-&gt; DynFlags
-&gt; DumpFlag
-&gt; FilePath
-&gt; DumpFormat
-&gt; MsgDoc
-&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier hs-var hs-var">dumpIfSet_dyn_printer</span></a></span></span><span> </span><span id="local-6989586621680826134"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826134"><span class="hs-identifier hs-var">printer</span></a></span></span><span> </span><span id="local-6989586621680826133"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826133"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826132"><span class="annot"><span class="annottext">DumpFlag
</span><a href="#local-6989586621680826132"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621680826131"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826131"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span id="local-6989586621680826130"><span class="annot"><span class="annottext">DumpFormat
</span><a href="#local-6989586621680826130"><span class="hs-identifier hs-var">fmt</span></a></span></span><span> </span><span id="local-6989586621680826129"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826129"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-470"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="#local-6989586621680826132"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826133"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-471"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826126"><span class="annot"><span class="annottext">sty :: PprStyle
</span><a href="#local-6989586621680826126"><span class="hs-identifier hs-var hs-var">sty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrintUnqualified -&gt; PprStyle
</span><a href="GHC.Utils.Outputable.html#mkDumpStyle"><span class="hs-identifier hs-var">mkDumpStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680826134"><span class="hs-identifier hs-var">printer</span></a></span><span>
</span><span id="line-472"></span><span>      </span><span class="annot"><span class="annottext">DumpAction
</span><a href="GHC.Utils.Error.html#dumpAction"><span class="hs-identifier hs-var">dumpAction</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826133"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826126"><span class="hs-identifier hs-var">sty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DumpFlag -&gt; DumpOptions
</span><a href="GHC.Utils.Error.html#dumpOptionsFromFlag"><span class="hs-identifier hs-var">dumpOptionsFromFlag</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="#local-6989586621680826132"><span class="hs-identifier hs-var">flag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826131"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="#local-6989586621680826130"><span class="hs-identifier hs-var">fmt</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826129"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-473"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-pragma hs-type">dumpIfSet_dyn_printer</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- see Note [INLINE conditional tracing utilities]</span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span class="annot"><a href="GHC.Utils.Error.html#mkDumpDoc"><span class="hs-identifier hs-type">mkDumpDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-476"></span><span id="mkDumpDoc"><span class="annot"><span class="annottext">mkDumpDoc :: FilePath -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkDumpDoc"><span class="hs-identifier hs-var hs-var">mkDumpDoc</span></a></span></span><span> </span><span id="local-6989586621680826124"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826124"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span id="local-6989586621680826123"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826123"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-477"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-478"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826122"><span class="hs-identifier hs-var">line</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826124"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826122"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-479"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826123"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-480"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-481"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-482"></span><span>        </span><span id="local-6989586621680826122"><span class="annot"><span class="annottext">line :: MsgDoc
</span><a href="#local-6989586621680826122"><span class="hs-identifier hs-var hs-var">line</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">20</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span class="hs-special">)</span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="hs-comment">-- | Ensure that a dump file is created even if it stays empty</span><span>
</span><span id="line-486"></span><span class="annot"><a href="GHC.Utils.Error.html#touchDumpFile"><span class="hs-identifier hs-type">touchDumpFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-487"></span><span id="touchDumpFile"><span class="annot"><span class="annottext">touchDumpFile :: DynFlags -&gt; DumpOptions -&gt; IO ()
</span><a href="GHC.Utils.Error.html#touchDumpFile"><span class="hs-identifier hs-var hs-var">touchDumpFile</span></a></span></span><span> </span><span id="local-6989586621680826121"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826121"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826120"><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826120"><span class="hs-identifier hs-var">dumpOpt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpOptions -&gt; (Maybe Handle -&gt; IO ()) -&gt; IO ()
</span><a href="GHC.Utils.Error.html#withDumpFileHandle"><span class="hs-identifier hs-var">withDumpFileHandle</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826121"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826120"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO () -&gt; Maybe Handle -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span class="hs-comment">-- | Run an action with the handle of a 'DumpFlag' if we are outputting to a</span><span>
</span><span id="line-490"></span><span class="hs-comment">-- file, otherwise 'Nothing'.</span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.Utils.Error.html#withDumpFileHandle"><span class="hs-identifier hs-type">withDumpFileHandle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span id="withDumpFileHandle"><span class="annot"><span class="annottext">withDumpFileHandle :: DynFlags -&gt; DumpOptions -&gt; (Maybe Handle -&gt; IO ()) -&gt; IO ()
</span><a href="GHC.Utils.Error.html#withDumpFileHandle"><span class="hs-identifier hs-var hs-var">withDumpFileHandle</span></a></span></span><span> </span><span id="local-6989586621680826118"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826118"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826117"><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826117"><span class="hs-identifier hs-var">dumpOpt</span></a></span></span><span> </span><span id="local-6989586621680826116"><span class="annot"><span class="annottext">Maybe Handle -&gt; IO ()
</span><a href="#local-6989586621680826116"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-493"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826115"><span class="annot"><span class="annottext">mFile :: Maybe FilePath
</span><a href="#local-6989586621680826115"><span class="hs-identifier hs-var hs-var">mFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpOptions -&gt; Maybe FilePath
</span><a href="GHC.Utils.Error.html#chooseDumpFile"><span class="hs-identifier hs-var">chooseDumpFile</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826118"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826117"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span>
</span><span id="line-494"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621680826115"><span class="hs-identifier hs-var">mFile</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-495"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826113"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826113"><span class="hs-identifier hs-var">fileName</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-496"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826112"><span class="annot"><span class="annottext">gdref :: IORef (Set FilePath)
</span><a href="#local-6989586621680826112"><span class="hs-identifier hs-var hs-var">gdref</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IORef (Set FilePath)
</span><a href="GHC.Driver.Session.html#generatedDumps"><span class="hs-identifier hs-var hs-var">generatedDumps</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826118"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-497"></span><span>        </span><span id="local-6989586621680826110"><span class="annot"><span class="annottext">Set FilePath
</span><a href="#local-6989586621680826110"><span class="hs-identifier hs-var">gd</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef (Set FilePath) -&gt; IO (Set FilePath)
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (Set FilePath)
</span><a href="#local-6989586621680826112"><span class="hs-identifier hs-var">gdref</span></a></span><span>
</span><span id="line-498"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826106"><span class="annot"><span class="annottext">append :: Bool
</span><a href="#local-6989586621680826106"><span class="hs-identifier hs-var hs-var">append</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Set FilePath -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-identifier hs-var">Set.member</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826113"><span class="hs-identifier hs-var">fileName</span></a></span><span> </span><span class="annot"><span class="annottext">Set FilePath
</span><a href="#local-6989586621680826110"><span class="hs-identifier hs-var">gd</span></a></span><span>
</span><span id="line-499"></span><span>            </span><span id="local-6989586621680826104"><span class="annot"><span class="annottext">mode :: IOMode
</span><a href="#local-6989586621680826104"><span class="hs-identifier hs-var hs-var">mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826106"><span class="hs-identifier hs-var">append</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#AppendMode"><span class="hs-identifier hs-var">AppendMode</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#WriteMode"><span class="hs-identifier hs-var">WriteMode</span></a></span><span>
</span><span id="line-500"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680826106"><span class="hs-identifier hs-var">append</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-501"></span><span>            </span><span class="annot"><span class="annottext">IORef (Set FilePath) -&gt; Set FilePath -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef (Set FilePath)
</span><a href="#local-6989586621680826112"><span class="hs-identifier hs-var">gdref</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Set FilePath -&gt; Set FilePath
forall a. Ord a =&gt; a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#insert"><span class="hs-identifier hs-var">Set.insert</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826113"><span class="hs-identifier hs-var">fileName</span></a></span><span> </span><span class="annot"><span class="annottext">Set FilePath
</span><a href="#local-6989586621680826110"><span class="hs-identifier hs-var">gd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-502"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; FilePath -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#createDirectoryIfMissing"><span class="hs-identifier hs-var">createDirectoryIfMissing</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826113"><span class="hs-identifier hs-var">fileName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span>        </span><span class="annot"><span class="annottext">FilePath -&gt; IOMode -&gt; (Handle -&gt; IO ()) -&gt; IO ()
forall r. FilePath -&gt; IOMode -&gt; (Handle -&gt; IO r) -&gt; IO r
</span><a href="../../base/src/System.IO.html#withFile"><span class="hs-identifier hs-var">withFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826113"><span class="hs-identifier hs-var">fileName</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="#local-6989586621680826104"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO ()) -&gt; IO ()) -&gt; (Handle -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680826096"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680826096"><span class="hs-identifier hs-var">handle</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-504"></span><span>            </span><span class="hs-comment">-- We do not want the dump file to be affected by</span><span>
</span><span id="line-505"></span><span>            </span><span class="hs-comment">-- environment variables, but instead to always use</span><span>
</span><span id="line-506"></span><span>            </span><span class="hs-comment">-- UTF8. See:</span><span>
</span><span id="line-507"></span><span>            </span><span class="hs-comment">-- https://gitlab.haskell.org/ghc/ghc/issues/10762</span><span>
</span><span id="line-508"></span><span>            </span><span class="annot"><span class="annottext">Handle -&gt; TextEncoding -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetEncoding"><span class="hs-identifier hs-var">hSetEncoding</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680826096"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">TextEncoding
</span><a href="../../base/src/GHC.IO.Encoding.html#utf8"><span class="hs-identifier hs-var">utf8</span></a></span><span>
</span><span id="line-509"></span><span>
</span><span id="line-510"></span><span>            </span><span class="annot"><span class="annottext">Maybe Handle -&gt; IO ()
</span><a href="#local-6989586621680826116"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Handle -&gt; Maybe Handle
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680826096"><span class="hs-identifier hs-var">handle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-511"></span><span>      </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Handle -&gt; IO ()
</span><a href="#local-6989586621680826116"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-512"></span><span>
</span><span id="line-513"></span><span>
</span><span id="line-514"></span><span class="hs-comment">-- | Write out a dump.</span><span>
</span><span id="line-515"></span><span class="hs-comment">-- If --dump-to-file is set then this goes to a file.</span><span>
</span><span id="line-516"></span><span class="hs-comment">-- otherwise emit to stdout.</span><span>
</span><span id="line-517"></span><span class="hs-comment">--</span><span>
</span><span id="line-518"></span><span class="hs-comment">-- When @hdr@ is empty, we print in a more compact format (no separators and</span><span>
</span><span id="line-519"></span><span class="hs-comment">-- blank lines)</span><span>
</span><span id="line-520"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpSDocWithStyle"><span class="hs-identifier hs-type">dumpSDocWithStyle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PprStyle"><span class="hs-identifier hs-type">PprStyle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span id="dumpSDocWithStyle"><span class="annot"><span class="annottext">dumpSDocWithStyle :: PprStyle -&gt; DynFlags -&gt; DumpOptions -&gt; FilePath -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpSDocWithStyle"><span class="hs-identifier hs-var hs-var">dumpSDocWithStyle</span></a></span></span><span> </span><span id="local-6989586621680826092"><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826092"><span class="hs-identifier hs-var">sty</span></a></span></span><span> </span><span id="local-6989586621680826091"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826091"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826090"><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826090"><span class="hs-identifier hs-var">dumpOpt</span></a></span></span><span> </span><span id="local-6989586621680826089"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826089"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span id="local-6989586621680826088"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826088"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-522"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpOptions -&gt; (Maybe Handle -&gt; IO ()) -&gt; IO ()
</span><a href="GHC.Utils.Error.html#withDumpFileHandle"><span class="hs-identifier hs-var">withDumpFileHandle</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826091"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826090"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle -&gt; IO ()
</span><a href="#local-6989586621680826087"><span class="hs-identifier hs-var">writeDump</span></a></span><span>
</span><span id="line-523"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-524"></span><span>    </span><span class="hs-comment">-- write dump to file</span><span>
</span><span id="line-525"></span><span>    </span><span id="local-6989586621680826087"><span class="annot"><span class="annottext">writeDump :: Maybe Handle -&gt; IO ()
</span><a href="#local-6989586621680826087"><span class="hs-identifier hs-var hs-var">writeDump</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826081"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680826081"><span class="hs-identifier hs-var">handle</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-526"></span><span>        </span><span id="local-6989586621680826080"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826080"><span class="hs-identifier hs-var">doc'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826089"><span class="hs-identifier hs-var">hdr</span></a></span><span>
</span><span id="line-527"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IO MsgDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826088"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-528"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680826079"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680826079"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO UTCTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getCurrentTime"><span class="hs-identifier hs-var">getCurrentTime</span></a></span><span>
</span><span id="line-529"></span><span>                        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826075"><span class="annot"><span class="annottext">timeStamp :: MsgDoc
</span><a href="#local-6989586621680826075"><span class="hs-identifier hs-var hs-var">timeStamp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_SuppressTimestamps"><span class="hs-identifier hs-var">Opt_SuppressTimestamps</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826091"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-530"></span><span>                                          </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-531"></span><span>                                          </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UTCTime -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680826079"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-532"></span><span>                        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680826073"><span class="annot"><span class="annottext">d :: MsgDoc
</span><a href="#local-6989586621680826073"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826075"><span class="hs-identifier hs-var">timeStamp</span></a></span><span>
</span><span id="line-533"></span><span>                                </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span>
</span><span id="line-534"></span><span>                                </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826088"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-535"></span><span>                        </span><span class="annot"><span class="annottext">MsgDoc -&gt; IO MsgDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO MsgDoc) -&gt; MsgDoc -&gt; IO MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkDumpDoc"><span class="hs-identifier hs-var">mkDumpDoc</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826089"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826073"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-536"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; Handle -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#defaultLogActionHPrintDoc"><span class="hs-identifier hs-var">defaultLogActionHPrintDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826091"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680826081"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826092"><span class="hs-identifier hs-var">sty</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826080"><span class="hs-identifier hs-var">doc'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span>    </span><span class="hs-comment">-- write the dump to stdout</span><span>
</span><span id="line-539"></span><span>    </span><span class="annot"><a href="#local-6989586621680826087"><span class="hs-identifier hs-var">writeDump</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-540"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826069"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826069"><span class="hs-identifier hs-var">doc'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826068"><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826068"><span class="hs-identifier hs-var">severity</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-541"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826089"><span class="hs-identifier hs-var">hdr</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826088"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevOutput"><span class="hs-identifier hs-var">SevOutput</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-542"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Error.html#mkDumpDoc"><span class="hs-identifier hs-var">mkDumpDoc</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826089"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826088"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevDump"><span class="hs-identifier hs-var">SevDump</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-543"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826091"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="#local-6989586621680826068"><span class="hs-identifier hs-var">severity</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680826092"><span class="hs-identifier hs-var">sty</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826069"><span class="hs-identifier hs-var">doc'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-544"></span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- | Choose where to put a dump file based on DynFlags</span><span>
</span><span id="line-547"></span><span class="hs-comment">--</span><span>
</span><span id="line-548"></span><span class="annot"><a href="GHC.Utils.Error.html#chooseDumpFile"><span class="hs-identifier hs-type">chooseDumpFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-549"></span><span id="chooseDumpFile"><span class="annot"><span class="annottext">chooseDumpFile :: DynFlags -&gt; DumpOptions -&gt; Maybe FilePath
</span><a href="GHC.Utils.Error.html#chooseDumpFile"><span class="hs-identifier hs-var hs-var">chooseDumpFile</span></a></span></span><span> </span><span id="local-6989586621680826067"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826067"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826066"><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826066"><span class="hs-identifier hs-var">dumpOpt</span></a></span></span><span>
</span><span id="line-550"></span><span>
</span><span id="line-551"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_DumpToFile"><span class="hs-identifier hs-var">Opt_DumpToFile</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826067"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">DumpOptions -&gt; Bool
</span><a href="GHC.Utils.Error.html#dumpForcedToFile"><span class="hs-identifier hs-var hs-var">dumpForcedToFile</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826066"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span>
</span><span id="line-552"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826062"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826062"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621680826061"><span class="hs-identifier hs-var">getPrefix</span></a></span><span>
</span><span id="line-553"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; Maybe FilePath) -&gt; FilePath -&gt; Maybe FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621680826060"><span class="hs-identifier hs-var">setDir</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826062"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions -&gt; FilePath
</span><a href="GHC.Utils.Error.html#dumpSuffix"><span class="hs-identifier hs-var hs-var">dumpSuffix</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680826066"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-554"></span><span>
</span><span id="line-555"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-556"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680826061"><span class="annot"><span class="annottext">getPrefix :: Maybe FilePath
</span><a href="#local-6989586621680826061"><span class="hs-identifier hs-var hs-var">getPrefix</span></a></span></span><span>
</span><span id="line-559"></span><span>                 </span><span class="hs-comment">-- dump file location is being forced</span><span>
</span><span id="line-560"></span><span>                 </span><span class="hs-comment">--      by the --ddump-file-prefix flag.</span><span>
</span><span id="line-561"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826058"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826058"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#dumpPrefixForce"><span class="hs-identifier hs-var hs-var">dumpPrefixForce</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826067"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-562"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826058"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-563"></span><span>                 </span><span class="hs-comment">-- dump file location chosen by GHC.Driver.Pipeline.runPipeline</span><span>
</span><span id="line-564"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826056"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826056"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#dumpPrefix"><span class="hs-identifier hs-var hs-var">dumpPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826067"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-565"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826056"><span class="hs-identifier hs-var">prefix</span></a></span><span>
</span><span id="line-566"></span><span>                 </span><span class="hs-comment">-- we haven't got a place to put a dump file.</span><span>
</span><span id="line-567"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-568"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-569"></span><span>              </span><span id="local-6989586621680826060"><span class="annot"><span class="annottext">setDir :: ShowS
</span><a href="#local-6989586621680826060"><span class="hs-identifier hs-var hs-var">setDir</span></a></span></span><span> </span><span id="local-6989586621680826054"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826054"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#dumpDir"><span class="hs-identifier hs-var hs-var">dumpDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826067"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-570"></span><span>                         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826052"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826052"><span class="hs-identifier hs-var">d</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826052"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826054"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-571"></span><span>                         </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>       </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826054"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-572"></span><span>
</span><span id="line-573"></span><span class="hs-comment">-- | Dump options</span><span>
</span><span id="line-574"></span><span class="hs-comment">--</span><span>
</span><span id="line-575"></span><span class="hs-comment">-- Dumps are printed on stdout by default except when the `dumpForcedToFile`</span><span>
</span><span id="line-576"></span><span class="hs-comment">-- field is set to True.</span><span>
</span><span id="line-577"></span><span class="hs-comment">--</span><span>
</span><span id="line-578"></span><span class="hs-comment">-- When `dumpForcedToFile` is True or when `-ddump-to-file` is set, dumps are</span><span>
</span><span id="line-579"></span><span class="hs-comment">-- written into a file whose suffix is given in the `dumpSuffix` field.</span><span>
</span><span id="line-580"></span><span class="hs-comment">--</span><span>
</span><span id="line-581"></span><span class="hs-keyword">data</span><span> </span><span id="DumpOptions"><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-var">DumpOptions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="DumpOptions"><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-var">DumpOptions</span></a></span></span><span>
</span><span id="line-582"></span><span>   </span><span class="hs-special">{</span><span> </span><span id="dumpForcedToFile"><span class="annot"><span class="annottext">DumpOptions -&gt; Bool
</span><a href="GHC.Utils.Error.html#dumpForcedToFile"><span class="hs-identifier hs-var hs-var">dumpForcedToFile</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>   </span><span class="hs-comment">-- ^ Must be dumped into a file, even if</span><span>
</span><span id="line-583"></span><span>                                </span><span class="hs-comment">--   -ddump-to-file isn't set</span><span>
</span><span id="line-584"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="dumpSuffix"><span class="annot"><span class="annottext">DumpOptions -&gt; FilePath
</span><a href="GHC.Utils.Error.html#dumpSuffix"><span class="hs-identifier hs-var hs-var">dumpSuffix</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ Filename suffix used when dumped into</span><span>
</span><span id="line-585"></span><span>                                </span><span class="hs-comment">--   a file</span><span>
</span><span id="line-586"></span><span>   </span><span class="hs-special">}</span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span class="hs-comment">-- | Create dump options from a 'DumpFlag'</span><span>
</span><span id="line-589"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpOptionsFromFlag"><span class="hs-identifier hs-type">dumpOptionsFromFlag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#DumpFlag"><span class="hs-identifier hs-type">DumpFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span>
</span><span id="line-590"></span><span id="dumpOptionsFromFlag"><span class="annot"><span class="annottext">dumpOptionsFromFlag :: DumpFlag -&gt; DumpOptions
</span><a href="GHC.Utils.Error.html#dumpOptionsFromFlag"><span class="hs-identifier hs-var hs-var">dumpOptionsFromFlag</span></a></span></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_th_dec_file"><span class="hs-identifier hs-var">Opt_D_th_dec_file</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-591"></span><span>   </span><span class="annot"><span class="annottext">DumpOptions :: Bool -&gt; FilePath -&gt; DumpOptions
</span><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span>                        </span><span class="hs-comment">-- -dth-dec-file dumps expansions of TH</span><span>
</span><span id="line-592"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">dumpForcedToFile :: Bool
</span><a href="GHC.Utils.Error.html#dumpForcedToFile"><span class="hs-identifier hs-var">dumpForcedToFile</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>       </span><span class="hs-comment">-- splices into MODULE.th.hs even when</span><span>
</span><span id="line-593"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">dumpSuffix :: FilePath
</span><a href="GHC.Utils.Error.html#dumpSuffix"><span class="hs-identifier hs-var">dumpSuffix</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;th.hs&quot;</span></span><span>    </span><span class="hs-comment">-- -ddump-to-file isn't set</span><span>
</span><span id="line-594"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-595"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpOptionsFromFlag"><span class="hs-identifier hs-var">dumpOptionsFromFlag</span></a></span><span> </span><span id="local-6989586621680826049"><span class="annot"><span class="annottext">DumpFlag
</span><a href="#local-6989586621680826049"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-596"></span><span>   </span><span class="annot"><span class="annottext">DumpOptions :: Bool -&gt; FilePath -&gt; DumpOptions
</span><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span>
</span><span id="line-597"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">dumpForcedToFile :: Bool
</span><a href="GHC.Utils.Error.html#dumpForcedToFile"><span class="hs-identifier hs-var">dumpForcedToFile</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-598"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">dumpSuffix :: FilePath
</span><a href="GHC.Utils.Error.html#dumpSuffix"><span class="hs-identifier hs-var">dumpSuffix</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826048"><span class="hs-identifier hs-var">suffix</span></a></span><span> </span><span class="hs-comment">-- build a suffix from the flag name</span><span>
</span><span id="line-599"></span><span>      </span><span class="hs-special">}</span><span>                           </span><span class="hs-comment">-- e.g. -ddump-asm =&gt; &quot;.dump-asm&quot;</span><span>
</span><span id="line-600"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-601"></span><span>      </span><span id="local-6989586621680826045"><span class="annot"><span class="annottext">str :: FilePath
</span><a href="#local-6989586621680826045"><span class="hs-identifier hs-var hs-var">str</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="#local-6989586621680826049"><span class="hs-identifier hs-var">flag</span></a></span><span>
</span><span id="line-602"></span><span>      </span><span id="local-6989586621680826043"><span class="annot"><span class="annottext">suff :: FilePath
</span><a href="#local-6989586621680826043"><span class="hs-identifier hs-var hs-var">suff</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Maybe FilePath
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Maybe [a]
</span><a href="../../base/src/Data.OldList.html#stripPrefix"><span class="hs-identifier hs-var">stripPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Opt_D_&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826045"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-603"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680826041"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826041"><span class="hs-identifier hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826041"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-604"></span><span>             </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ShowS
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Bad flag name: &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826045"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span>      </span><span id="local-6989586621680826048"><span class="annot"><span class="annottext">suffix :: FilePath
</span><a href="#local-6989586621680826048"><span class="hs-identifier hs-var hs-var">suffix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; ShowS
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680826038"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826038"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826038"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'_'</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680826038"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826043"><span class="hs-identifier hs-var">suff</span></a></span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span>
</span><span id="line-608"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-609"></span><span class="hs-comment">-- Outputting messages from the compiler</span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span class="hs-comment">-- We want all messages to go through one place, so that we can</span><span>
</span><span id="line-612"></span><span class="hs-comment">-- redirect them if necessary.  For example, when GHC is used as a</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- library we might want to catch all messages that GHC tries to</span><span>
</span><span id="line-614"></span><span class="hs-comment">-- output and do something else with them.</span><span>
</span><span id="line-615"></span><span>
</span><span id="line-616"></span><span class="annot"><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-identifier hs-type">ifVerbose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span id="ifVerbose"><span class="annot"><span class="annottext">ifVerbose :: DynFlags -&gt; Int -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-identifier hs-var hs-var">ifVerbose</span></a></span></span><span> </span><span id="local-6989586621680826036"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826036"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826035"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826035"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span id="local-6989586621680826034"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826034"><span class="hs-identifier hs-var">act</span></a></span></span><span>
</span><span id="line-618"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826036"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680826035"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680826034"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-619"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-620"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-pragma hs-type">ifVerbose</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- see Note [INLINE conditional tracing utilities]</span><span>
</span><span id="line-621"></span><span>
</span><span id="line-622"></span><span class="annot"><a href="GHC.Utils.Error.html#errorMsg"><span class="hs-identifier hs-type">errorMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-623"></span><span id="errorMsg"><span class="annot"><span class="annottext">errorMsg :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#errorMsg"><span class="hs-identifier hs-var hs-var">errorMsg</span></a></span></span><span> </span><span id="local-6989586621680826032"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826032"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826031"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826031"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-624"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826032"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevError"><span class="hs-identifier hs-var">SevError</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultErrStyle"><span class="hs-identifier hs-var">defaultErrStyle</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826031"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-625"></span><span>
</span><span id="line-626"></span><span class="annot"><a href="GHC.Utils.Error.html#warningMsg"><span class="hs-identifier hs-type">warningMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-627"></span><span id="warningMsg"><span class="annot"><span class="annottext">warningMsg :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#warningMsg"><span class="hs-identifier hs-var hs-var">warningMsg</span></a></span></span><span> </span><span id="local-6989586621680826029"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826029"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826028"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826028"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-628"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826029"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevWarning"><span class="hs-identifier hs-var">SevWarning</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultErrStyle"><span class="hs-identifier hs-var">defaultErrStyle</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826028"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-629"></span><span>
</span><span id="line-630"></span><span class="annot"><a href="GHC.Utils.Error.html#fatalErrorMsg"><span class="hs-identifier hs-type">fatalErrorMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-631"></span><span id="fatalErrorMsg"><span class="annot"><span class="annottext">fatalErrorMsg :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#fatalErrorMsg"><span class="hs-identifier hs-var hs-var">fatalErrorMsg</span></a></span></span><span> </span><span id="local-6989586621680826027"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826027"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826026"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826026"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-632"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826027"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevFatal"><span class="hs-identifier hs-var">SevFatal</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultErrStyle"><span class="hs-identifier hs-var">defaultErrStyle</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826026"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-633"></span><span>
</span><span id="line-634"></span><span class="annot"><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-type">fatalErrorMsg''</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#FatalMessager"><span class="hs-identifier hs-type">FatalMessager</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-635"></span><span id="fatalErrorMsg%27%27"><span class="annot"><span class="annottext">fatalErrorMsg'' :: (FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#fatalErrorMsg%27%27"><span class="hs-identifier hs-var hs-var">fatalErrorMsg''</span></a></span></span><span> </span><span id="local-6989586621680826024"><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="#local-6989586621680826024"><span class="hs-identifier hs-var">fm</span></a></span></span><span> </span><span id="local-6989586621680826023"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826023"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="#local-6989586621680826024"><span class="hs-identifier hs-var">fm</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826023"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-636"></span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Utils.Error.html#compilationProgressMsg"><span class="hs-identifier hs-type">compilationProgressMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-638"></span><span id="compilationProgressMsg"><span class="annot"><span class="annottext">compilationProgressMsg :: DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#compilationProgressMsg"><span class="hs-identifier hs-var hs-var">compilationProgressMsg</span></a></span></span><span> </span><span id="local-6989586621680826022"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826022"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826021"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826021"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-639"></span><span>    </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="../../base/src/Debug.Trace.html#traceEventIO"><span class="hs-identifier hs-var">traceEventIO</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;GHC progress: &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826021"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-640"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-identifier hs-var">ifVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826022"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-641"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logOutput"><span class="hs-identifier hs-var">logOutput</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826022"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultUserStyle"><span class="hs-identifier hs-var">defaultUserStyle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826021"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span class="annot"><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier hs-type">showPass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-644"></span><span id="showPass"><span class="annot"><span class="annottext">showPass :: DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier hs-var hs-var">showPass</span></a></span></span><span> </span><span id="local-6989586621680826018"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826018"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826017"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826017"><span class="hs-identifier hs-var">what</span></a></span></span><span>
</span><span id="line-645"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-identifier hs-var">ifVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826018"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-646"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826018"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultUserStyle"><span class="hs-identifier hs-var">defaultUserStyle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;***&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680826017"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-647"></span><span>
</span><span id="line-648"></span><span class="hs-keyword">data</span><span> </span><span id="PrintTimings"><span class="annot"><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PrintTimings"><span class="annot"><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="DontPrintTimings"><span class="annot"><a href="GHC.Utils.Error.html#DontPrintTimings"><span class="hs-identifier hs-var">DontPrintTimings</span></a></span></span><span>
</span><span id="line-649"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680826011"><span id="local-6989586621680826013"><span class="annot"><span class="annottext">PrintTimings -&gt; PrintTimings -&gt; Bool
(PrintTimings -&gt; PrintTimings -&gt; Bool)
-&gt; (PrintTimings -&gt; PrintTimings -&gt; Bool) -&gt; Eq PrintTimings
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: PrintTimings -&gt; PrintTimings -&gt; Bool
$c/= :: PrintTimings -&gt; PrintTimings -&gt; Bool
== :: PrintTimings -&gt; PrintTimings -&gt; Bool
$c== :: PrintTimings -&gt; PrintTimings -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680826004"><span id="local-6989586621680826006"><span id="local-6989586621680826008"><span class="annot"><span class="annottext">Int -&gt; PrintTimings -&gt; ShowS
[PrintTimings] -&gt; ShowS
PrintTimings -&gt; FilePath
(Int -&gt; PrintTimings -&gt; ShowS)
-&gt; (PrintTimings -&gt; FilePath)
-&gt; ([PrintTimings] -&gt; ShowS)
-&gt; Show PrintTimings
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; FilePath) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [PrintTimings] -&gt; ShowS
$cshowList :: [PrintTimings] -&gt; ShowS
show :: PrintTimings -&gt; FilePath
$cshow :: PrintTimings -&gt; FilePath
showsPrec :: Int -&gt; PrintTimings -&gt; ShowS
$cshowsPrec :: Int -&gt; PrintTimings -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span>
</span><span id="line-651"></span><span class="hs-comment">-- | Time a compilation phase.</span><span>
</span><span id="line-652"></span><span class="hs-comment">--</span><span>
</span><span id="line-653"></span><span class="hs-comment">-- When timings are enabled (e.g. with the @-v2@ flag), the allocations</span><span>
</span><span id="line-654"></span><span class="hs-comment">-- and CPU time used by the phase will be reported to stderr. Consider</span><span>
</span><span id="line-655"></span><span class="hs-comment">-- a typical usage:</span><span>
</span><span id="line-656"></span><span class="hs-comment">-- @withTiming getDynFlags (text &quot;simplify&quot;) force PrintTimings pass@.</span><span>
</span><span id="line-657"></span><span class="hs-comment">-- When timings are enabled the following costs are included in the</span><span>
</span><span id="line-658"></span><span class="hs-comment">-- produced accounting,</span><span>
</span><span id="line-659"></span><span class="hs-comment">--</span><span>
</span><span id="line-660"></span><span class="hs-comment">--  - The cost of executing @pass@ to a result @r@ in WHNF</span><span>
</span><span id="line-661"></span><span class="hs-comment">--  - The cost of evaluating @force r@ to WHNF (e.g. @()@)</span><span>
</span><span id="line-662"></span><span class="hs-comment">--</span><span>
</span><span id="line-663"></span><span class="hs-comment">-- The choice of the @force@ function depends upon the amount of forcing</span><span>
</span><span id="line-664"></span><span class="hs-comment">-- desired; the goal here is to ensure that the cost of evaluating the result</span><span>
</span><span id="line-665"></span><span class="hs-comment">-- is, to the greatest extent possible, included in the accounting provided by</span><span>
</span><span id="line-666"></span><span class="hs-comment">-- 'withTiming'. Often the pass already sufficiently forces its result during</span><span>
</span><span id="line-667"></span><span class="hs-comment">-- construction; in this case @const ()@ is a reasonable choice.</span><span>
</span><span id="line-668"></span><span class="hs-comment">-- In other cases, it is necessary to evaluate the result to normal form, in</span><span>
</span><span id="line-669"></span><span class="hs-comment">-- which case something like @Control.DeepSeq.rnf@ is appropriate.</span><span>
</span><span id="line-670"></span><span class="hs-comment">--</span><span>
</span><span id="line-671"></span><span class="hs-comment">-- To avoid adversely affecting compiler performance when timings are not</span><span>
</span><span id="line-672"></span><span class="hs-comment">-- requested, the result is only forced when timings are enabled.</span><span>
</span><span id="line-673"></span><span class="hs-comment">--</span><span>
</span><span id="line-674"></span><span class="hs-comment">-- See Note [withTiming] for more.</span><span>
</span><span id="line-675"></span><span id="local-6989586621680826610"><span id="local-6989586621680826612"><span class="annot"><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-type">withTiming</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826612"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-676"></span><span>           </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>     </span><span class="hs-comment">-- ^ DynFlags</span><span>
</span><span id="line-677"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>         </span><span class="hs-comment">-- ^ The name of the phase</span><span>
</span><span id="line-678"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680826610"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- ^ A function to force the result</span><span>
</span><span id="line-679"></span><span>                           </span><span class="hs-comment">-- (often either @const ()@ or 'rnf')</span><span>
</span><span id="line-680"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826612"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826610"><span class="hs-identifier hs-type">a</span></a></span><span>          </span><span class="hs-comment">-- ^ The body of the phase to be timed</span><span>
</span><span id="line-681"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826612"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826610"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-682"></span><span id="withTiming"><span class="annot"><span class="annottext">withTiming :: forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var hs-var">withTiming</span></a></span></span><span> </span><span id="local-6989586621680826001"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826001"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680826000"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826000"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621680825999"><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825999"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621680825998"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825998"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-683"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-var">withTiming'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680826001"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680826000"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825999"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825998"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-684"></span><span>
</span><span id="line-685"></span><span class="hs-comment">-- | Like withTiming but get DynFlags from the Monad.</span><span>
</span><span id="line-686"></span><span id="local-6989586621680826603"><span id="local-6989586621680826605"><span class="annot"><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier hs-type">withTimingD</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826605"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HasDynFlags"><span class="hs-identifier hs-type">HasDynFlags</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826605"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-687"></span><span>           </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>         </span><span class="hs-comment">-- ^ The name of the phase</span><span>
</span><span id="line-688"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680826603"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- ^ A function to force the result</span><span>
</span><span id="line-689"></span><span>                           </span><span class="hs-comment">-- (often either @const ()@ or 'rnf')</span><span>
</span><span id="line-690"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826605"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826603"><span class="hs-identifier hs-type">a</span></a></span><span>          </span><span class="hs-comment">-- ^ The body of the phase to be timed</span><span>
</span><span id="line-691"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826605"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826603"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-692"></span><span id="withTimingD"><span class="annot"><span class="annottext">withTimingD :: forall (m :: * -&gt; *) a.
(MonadIO m, HasDynFlags m) =&gt;
MsgDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier hs-var hs-var">withTimingD</span></a></span></span><span> </span><span id="local-6989586621680825989"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825989"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621680825988"><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825988"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621680825987"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825987"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-693"></span><span>  </span><span id="local-6989586621680825986"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825986"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-694"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-var">withTiming'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825986"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825989"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825988"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825987"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span>
</span><span id="line-697"></span><span class="hs-comment">-- | Same as 'withTiming', but doesn't print timings in the</span><span>
</span><span id="line-698"></span><span class="hs-comment">--   console (when given @-vN@, @N &gt;= 2@ or @-ddump-timings@).</span><span>
</span><span id="line-699"></span><span class="hs-comment">--</span><span>
</span><span id="line-700"></span><span class="hs-comment">--   See Note [withTiming] for more.</span><span>
</span><span id="line-701"></span><span id="local-6989586621680825983"><span id="local-6989586621680825984"><span class="annot"><a href="GHC.Utils.Error.html#withTimingSilent"><span class="hs-identifier hs-type">withTimingSilent</span></a></span><span>
</span><span id="line-702"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825984"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-703"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>   </span><span class="hs-comment">-- ^ DynFlags</span><span>
</span><span id="line-704"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>       </span><span class="hs-comment">-- ^ The name of the phase</span><span>
</span><span id="line-705"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680825983"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ A function to force the result</span><span>
</span><span id="line-706"></span><span>                </span><span class="hs-comment">-- (often either @const ()@ or 'rnf')</span><span>
</span><span id="line-707"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825984"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825983"><span class="hs-identifier hs-type">a</span></a></span><span>        </span><span class="hs-comment">-- ^ The body of the phase to be timed</span><span>
</span><span id="line-708"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825984"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825983"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-709"></span><span id="withTimingSilent"><span class="annot"><span class="annottext">withTimingSilent :: forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingSilent"><span class="hs-identifier hs-var hs-var">withTimingSilent</span></a></span></span><span> </span><span id="local-6989586621680825980"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825980"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825979"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825979"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621680825978"><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825978"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621680825977"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825977"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-710"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-var">withTiming'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825980"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825979"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825978"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#DontPrintTimings"><span class="hs-identifier hs-var">DontPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825977"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-711"></span><span>
</span><span id="line-712"></span><span class="hs-comment">-- | Same as 'withTiming', but doesn't print timings in the</span><span>
</span><span id="line-713"></span><span class="hs-comment">--   console (when given @-vN@, @N &gt;= 2@ or @-ddump-timings@)</span><span>
</span><span id="line-714"></span><span class="hs-comment">--   and gets the DynFlags from the given Monad.</span><span>
</span><span id="line-715"></span><span class="hs-comment">--</span><span>
</span><span id="line-716"></span><span class="hs-comment">--   See Note [withTiming] for more.</span><span>
</span><span id="line-717"></span><span id="local-6989586621680825975"><span id="local-6989586621680825976"><span class="annot"><a href="GHC.Utils.Error.html#withTimingSilentD"><span class="hs-identifier hs-type">withTimingSilentD</span></a></span><span>
</span><span id="line-718"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825976"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HasDynFlags"><span class="hs-identifier hs-type">HasDynFlags</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825976"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-719"></span><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>       </span><span class="hs-comment">-- ^ The name of the phase</span><span>
</span><span id="line-720"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680825975"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ A function to force the result</span><span>
</span><span id="line-721"></span><span>                </span><span class="hs-comment">-- (often either @const ()@ or 'rnf')</span><span>
</span><span id="line-722"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825975"><span class="hs-identifier hs-type">a</span></a></span><span>        </span><span class="hs-comment">-- ^ The body of the phase to be timed</span><span>
</span><span id="line-723"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680825975"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-724"></span><span id="withTimingSilentD"><span class="annot"><span class="annottext">withTimingSilentD :: forall (m :: * -&gt; *) a.
(MonadIO m, HasDynFlags m) =&gt;
MsgDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingSilentD"><span class="hs-identifier hs-var hs-var">withTimingSilentD</span></a></span></span><span> </span><span id="local-6989586621680825968"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825968"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621680825967"><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825967"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621680825966"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825966"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-725"></span><span>  </span><span id="local-6989586621680825965"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825965"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-726"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-var">withTiming'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825965"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825968"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825967"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#DontPrintTimings"><span class="hs-identifier hs-var">DontPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825966"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span class="hs-comment">-- | Worker for 'withTiming' and 'withTimingSilent'.</span><span>
</span><span id="line-729"></span><span id="local-6989586621680826606"><span id="local-6989586621680826607"><span class="annot"><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-type">withTiming'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826607"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-730"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>   </span><span class="hs-comment">-- ^ A means of getting a 'DynFlags' (often</span><span>
</span><span id="line-731"></span><span>                            </span><span class="hs-comment">-- 'getDynFlags' will work here)</span><span>
</span><span id="line-732"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>         </span><span class="hs-comment">-- ^ The name of the phase</span><span>
</span><span id="line-733"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680826606"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- ^ A function to force the result</span><span>
</span><span id="line-734"></span><span>                            </span><span class="hs-comment">-- (often either @const ()@ or 'rnf')</span><span>
</span><span id="line-735"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-type">PrintTimings</span></a></span><span> </span><span class="hs-comment">-- ^ Whether to print the timings</span><span>
</span><span id="line-736"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826607"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826606"><span class="hs-identifier hs-type">a</span></a></span><span>          </span><span class="hs-comment">-- ^ The body of the phase to be timed</span><span>
</span><span id="line-737"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826607"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826606"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-738"></span><span id="withTiming%27"><span class="annot"><span class="annottext">withTiming' :: forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; MsgDoc -&gt; (a -&gt; ()) -&gt; PrintTimings -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming%27"><span class="hs-identifier hs-var hs-var">withTiming'</span></a></span></span><span> </span><span id="local-6989586621680825925"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825924"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621680825923"><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825923"><span class="hs-identifier hs-var">force_result</span></a></span></span><span> </span><span id="local-6989586621680825922"><span class="annot"><span class="annottext">PrintTimings
</span><a href="#local-6989586621680825922"><span class="hs-identifier hs-var">prtimings</span></a></span></span><span> </span><span id="local-6989586621680825921"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825921"><span class="hs-identifier hs-var">action</span></a></span></span><span>
</span><span id="line-739"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_timings"><span class="hs-identifier hs-var">Opt_D_dump_timings</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-740"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
</span><a href="#local-6989586621680825919"><span class="hs-identifier hs-var">whenPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-741"></span><span>                    </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultUserStyle"><span class="hs-identifier hs-var">defaultUserStyle</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-742"></span><span>                      </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;***&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span>
</span><span id="line-743"></span><span>                  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680825918"><span class="annot"><span class="annottext">ctx :: SDocContext
</span><a href="#local-6989586621680825918"><span class="hs-identifier hs-var hs-var">ctx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDocContext
</span><a href="GHC.Driver.Session.html#initDefaultSDocContext"><span class="hs-identifier hs-var">initDefaultSDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-744"></span><span>                  </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; m ()
</span><a href="#local-6989586621680825916"><span class="hs-identifier hs-var">eventBegins</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825918"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span><span>
</span><span id="line-745"></span><span>                  </span><span id="local-6989586621680825915"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825915"><span class="hs-identifier hs-var">alloc0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Int64 -&gt; m Int64
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO Int64
</span><a href="../../base/src/GHC.Conc.Sync.html#getAllocationCounter"><span class="hs-identifier hs-var">getAllocationCounter</span></a></span><span>
</span><span id="line-746"></span><span>                  </span><span id="local-6989586621680825913"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680825913"><span class="hs-identifier hs-var">start</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Integer -&gt; m Integer
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO Integer
</span><a href="../../base/src/System.CPUTime.html#getCPUTime"><span class="hs-identifier hs-var">getCPUTime</span></a></span><span>
</span><span id="line-747"></span><span>                  </span><span class="hs-glyph">!</span><span id="local-6989586621680825911"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825911"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825921"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-748"></span><span>                  </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">() -&gt; m ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(() -&gt; m ()) -&gt; () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
</span><a href="#local-6989586621680825923"><span class="hs-identifier hs-var">force_result</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825911"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-749"></span><span>                  </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; m ()
</span><a href="#local-6989586621680825910"><span class="hs-identifier hs-var">eventEnds</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825918"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span><span>
</span><span id="line-750"></span><span>                  </span><span id="local-6989586621680825909"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680825909"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Integer -&gt; m Integer
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO Integer
</span><a href="../../base/src/System.CPUTime.html#getCPUTime"><span class="hs-identifier hs-var">getCPUTime</span></a></span><span>
</span><span id="line-751"></span><span>                  </span><span id="local-6989586621680825908"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825908"><span class="hs-identifier hs-var">alloc1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Int64 -&gt; m Int64
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO Int64
</span><a href="../../base/src/GHC.Conc.Sync.html#getAllocationCounter"><span class="hs-identifier hs-var">getAllocationCounter</span></a></span><span>
</span><span id="line-752"></span><span>                  </span><span class="hs-comment">-- recall that allocation counter counts down</span><span>
</span><span id="line-753"></span><span>                  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680825905"><span class="annot"><span class="annottext">alloc :: Int64
</span><a href="#local-6989586621680825905"><span class="hs-identifier hs-var hs-var">alloc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825915"><span class="hs-identifier hs-var">alloc0</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825908"><span class="hs-identifier hs-var">alloc1</span></a></span><span>
</span><span id="line-754"></span><span>                      </span><span id="local-6989586621680825897"><span class="annot"><span class="annottext">time :: Double
</span><a href="#local-6989586621680825897"><span class="hs-identifier hs-var hs-var">time</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Double
forall a b. (Real a, Fractional b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#realToFrac"><span class="hs-identifier hs-var">realToFrac</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680825909"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680825913"><span class="hs-identifier hs-var">start</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Double -&gt; Double -&gt; Double
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><span class="hs-number">1e-9</span></span><span>
</span><span id="line-755"></span><span>
</span><span id="line-756"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="#local-6989586621680825922"><span class="hs-identifier hs-var">prtimings</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings -&gt; PrintTimings -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-757"></span><span>                      </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultUserStyle"><span class="hs-identifier hs-var">defaultUserStyle</span></a></span><span>
</span><span id="line-758"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;!!!&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;finished in&quot;</span></span><span>
</span><span id="line-759"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Double -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#doublePrec"><span class="hs-identifier hs-var">doublePrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621680825897"><span class="hs-identifier hs-var">time</span></a></span><span>
</span><span id="line-760"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;milliseconds&quot;</span></span><span>
</span><span id="line-761"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span>
</span><span id="line-762"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;allocated&quot;</span></span><span>
</span><span id="line-763"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Double -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#doublePrec"><span class="hs-identifier hs-var">doublePrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Double
forall a b. (Real a, Fractional b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#realToFrac"><span class="hs-identifier hs-var">realToFrac</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825905"><span class="hs-identifier hs-var">alloc</span></a></span><span> </span><span class="annot"><span class="annottext">Double -&gt; Double -&gt; Double
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><span class="hs-number">1024</span></span><span> </span><span class="annot"><span class="annottext">Double -&gt; Double -&gt; Double
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><span class="hs-number">1024</span></span><span class="hs-special">)</span><span>
</span><span id="line-764"></span><span>                           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;megabytes&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span>                  </span><span class="annot"><span class="annottext">IO () -&gt; m ()
</span><a href="#local-6989586621680825919"><span class="hs-identifier hs-var">whenPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-767"></span><span>                      </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; FilePath -&gt; DumpFormat -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825925"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_timings"><span class="hs-identifier hs-var">Opt_D_dump_timings</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span><span>
</span><span id="line-768"></span><span>                          </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IO ()) -&gt; MsgDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; MsgDoc) -&gt; FilePath -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDocOneLine"><span class="hs-identifier hs-var">showSDocOneLine</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825918"><span class="hs-identifier hs-var">ctx</span></a></span><span>
</span><span id="line-769"></span><span>                          </span><span class="annot"><span class="annottext">(MsgDoc -&gt; FilePath) -&gt; MsgDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825924"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span>
</span><span id="line-770"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;alloc=&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621680825905"><span class="hs-identifier hs-var">alloc</span></a></span><span>
</span><span id="line-771"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;time=&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Double -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#doublePrec"><span class="hs-identifier hs-var">doublePrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621680825897"><span class="hs-identifier hs-var">time</span></a></span><span>
</span><span id="line-772"></span><span>                                 </span><span class="hs-special">]</span><span>
</span><span id="line-773"></span><span>                  </span><span class="annot"><span class="annottext">a -&gt; m a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825911"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-774"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621680825921"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680825919"><span class="annot"><span class="annottext">whenPrintTimings :: IO () -&gt; m ()
</span><a href="#local-6989586621680825919"><span class="hs-identifier hs-var hs-var">whenPrintTimings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; (IO () -&gt; IO ()) -&gt; IO () -&gt; m ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrintTimings
</span><a href="#local-6989586621680825922"><span class="hs-identifier hs-var">prtimings</span></a></span><span> </span><span class="annot"><span class="annottext">PrintTimings -&gt; PrintTimings -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PrintTimings
</span><a href="GHC.Utils.Error.html#PrintTimings"><span class="hs-identifier hs-var">PrintTimings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-777"></span><span>          </span><span id="local-6989586621680825916"><span class="annot"><span class="annottext">eventBegins :: SDocContext -&gt; MsgDoc -&gt; m ()
</span><a href="#local-6989586621680825916"><span class="hs-identifier hs-var hs-var">eventBegins</span></a></span></span><span> </span><span id="local-6989586621680825884"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825884"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621680825883"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825883"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-778"></span><span>            </span><span class="annot"><span class="annottext">IO () -&gt; m ()
</span><a href="#local-6989586621680825919"><span class="hs-identifier hs-var">whenPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="../../base/src/Debug.Trace.html#traceMarkerIO"><span class="hs-identifier hs-var">traceMarkerIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825881"><span class="hs-identifier hs-var">eventBeginsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825884"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825883"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-779"></span><span>            </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="../../base/src/Debug.Trace.html#traceEventIO"><span class="hs-identifier hs-var">traceEventIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825881"><span class="hs-identifier hs-var">eventBeginsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825884"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825883"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-780"></span><span>          </span><span id="local-6989586621680825910"><span class="annot"><span class="annottext">eventEnds :: SDocContext -&gt; MsgDoc -&gt; m ()
</span><a href="#local-6989586621680825910"><span class="hs-identifier hs-var hs-var">eventEnds</span></a></span></span><span> </span><span id="local-6989586621680825878"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825878"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621680825877"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825877"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-781"></span><span>            </span><span class="annot"><span class="annottext">IO () -&gt; m ()
</span><a href="#local-6989586621680825919"><span class="hs-identifier hs-var">whenPrintTimings</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="../../base/src/Debug.Trace.html#traceMarkerIO"><span class="hs-identifier hs-var">traceMarkerIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825876"><span class="hs-identifier hs-var">eventEndsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825878"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825877"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>            </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="../../base/src/Debug.Trace.html#traceEventIO"><span class="hs-identifier hs-var">traceEventIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825876"><span class="hs-identifier hs-var">eventEndsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825878"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825877"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-783"></span><span>
</span><span id="line-784"></span><span>          </span><span id="local-6989586621680825881"><span class="annot"><span class="annottext">eventBeginsDoc :: SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825881"><span class="hs-identifier hs-var hs-var">eventBeginsDoc</span></a></span></span><span> </span><span id="local-6989586621680825875"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825875"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621680825874"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825874"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDocOneLine"><span class="hs-identifier hs-var">showSDocOneLine</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825875"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; FilePath) -&gt; MsgDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;GHC:started:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825874"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-785"></span><span>          </span><span id="local-6989586621680825876"><span class="annot"><span class="annottext">eventEndsDoc :: SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="#local-6989586621680825876"><span class="hs-identifier hs-var hs-var">eventEndsDoc</span></a></span></span><span>   </span><span id="local-6989586621680825873"><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825873"><span class="hs-identifier hs-var">ctx</span></a></span></span><span> </span><span id="local-6989586621680825872"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825872"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; MsgDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDocOneLine"><span class="hs-identifier hs-var">showSDocOneLine</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext
</span><a href="#local-6989586621680825873"><span class="hs-identifier hs-var">ctx</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; FilePath) -&gt; MsgDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;GHC:finished:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825872"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-786"></span><span>
</span><span id="line-787"></span><span class="annot"><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-type">debugTraceMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span id="debugTraceMsg"><span class="annot"><span class="annottext">debugTraceMsg :: DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var hs-var">debugTraceMsg</span></a></span></span><span> </span><span id="local-6989586621680825871"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825871"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825870"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680825870"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span id="local-6989586621680825869"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825869"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-789"></span><span>   </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; IO () -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ifVerbose"><span class="hs-identifier hs-var">ifVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825871"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680825870"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-790"></span><span>      </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825871"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultDumpStyle"><span class="hs-identifier hs-var">defaultDumpStyle</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825869"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-791"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-pragma hs-type">debugTraceMsg</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- see Note [INLINE conditional tracing utilities]</span><span>
</span><span id="line-792"></span><span>
</span><span id="line-793"></span><span class="annot"><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-type">putMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-794"></span><span id="putMsg"><span class="annot"><span class="annottext">putMsg :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-var hs-var">putMsg</span></a></span></span><span> </span><span id="local-6989586621680825868"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825868"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825867"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825867"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825868"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PprStyle -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultUserStyle"><span class="hs-identifier hs-var">defaultUserStyle</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825867"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-795"></span><span>
</span><span id="line-796"></span><span class="annot"><a href="GHC.Utils.Error.html#printInfoForUser"><span class="hs-identifier hs-type">printInfoForUser</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-797"></span><span id="printInfoForUser"><span class="annot"><span class="annottext">printInfoForUser :: DynFlags -&gt; PrintUnqualified -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#printInfoForUser"><span class="hs-identifier hs-var hs-var">printInfoForUser</span></a></span></span><span> </span><span id="local-6989586621680825866"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825866"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825865"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680825865"><span class="hs-identifier hs-var">print_unqual</span></a></span></span><span> </span><span id="local-6989586621680825864"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825864"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-798"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var">logInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825866"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrintUnqualified -&gt; Depth -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withUserStyle"><span class="hs-identifier hs-var">withUserStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680825865"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">Depth
</span><a href="GHC.Utils.Outputable.html#AllTheWay"><span class="hs-identifier hs-var">AllTheWay</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825864"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span class="annot"><a href="GHC.Utils.Error.html#printOutputForUser"><span class="hs-identifier hs-type">printOutputForUser</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-801"></span><span id="printOutputForUser"><span class="annot"><span class="annottext">printOutputForUser :: DynFlags -&gt; PrintUnqualified -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#printOutputForUser"><span class="hs-identifier hs-var hs-var">printOutputForUser</span></a></span></span><span> </span><span id="local-6989586621680825861"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825861"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825860"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680825860"><span class="hs-identifier hs-var">print_unqual</span></a></span></span><span> </span><span id="local-6989586621680825859"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825859"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-802"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logOutput"><span class="hs-identifier hs-var">logOutput</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825861"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrintUnqualified -&gt; Depth -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#withUserStyle"><span class="hs-identifier hs-var">withUserStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621680825860"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">Depth
</span><a href="GHC.Utils.Outputable.html#AllTheWay"><span class="hs-identifier hs-var">AllTheWay</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825859"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>
</span><span id="line-804"></span><span class="annot"><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-type">logInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-805"></span><span id="logInfo"><span class="annot"><span class="annottext">logInfo :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logInfo"><span class="hs-identifier hs-var hs-var">logInfo</span></a></span></span><span> </span><span id="local-6989586621680825858"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825858"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825857"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825857"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-806"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825858"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevInfo"><span class="hs-identifier hs-var">SevInfo</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825857"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span class="hs-comment">-- | Like 'logInfo' but with 'SevOutput' rather then 'SevInfo'</span><span>
</span><span id="line-809"></span><span class="annot"><a href="GHC.Utils.Error.html#logOutput"><span class="hs-identifier hs-type">logOutput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span id="logOutput"><span class="annot"><span class="annottext">logOutput :: DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#logOutput"><span class="hs-identifier hs-var hs-var">logOutput</span></a></span></span><span> </span><span id="local-6989586621680825856"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825856"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825855"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825855"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-811"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825856"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevOutput"><span class="hs-identifier hs-var">SevOutput</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825855"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-812"></span><span>
</span><span id="line-813"></span><span id="local-6989586621680826585"><span id="local-6989586621680826587"><span class="annot"><a href="GHC.Utils.Error.html#prettyPrintGhcErrors"><span class="hs-identifier hs-type">prettyPrintGhcErrors</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html#ExceptionMonad"><span class="hs-identifier hs-type">ExceptionMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826587"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826587"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826585"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680826587"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680826585"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-814"></span><span id="prettyPrintGhcErrors"><span class="annot"><span class="annottext">prettyPrintGhcErrors :: forall (m :: * -&gt; *) a. ExceptionMonad m =&gt; DynFlags -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#prettyPrintGhcErrors"><span class="hs-identifier hs-var hs-var">prettyPrintGhcErrors</span></a></span></span><span> </span><span id="local-6989586621680825844"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825844"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-815"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GhcException -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var">MC.handle</span></a></span><span> </span><span class="annot"><span class="annottext">((GhcException -&gt; m a) -&gt; m a -&gt; m a)
-&gt; (GhcException -&gt; m a) -&gt; m a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680825843"><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621680825843"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621680825843"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-816"></span><span>                      </span><span class="annot"><a href="GHC.Utils.Panic.html#PprPanic"><span class="hs-identifier hs-type">PprPanic</span></a></span><span> </span><span id="local-6989586621680825841"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825841"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621680825840"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825840"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-817"></span><span>                          </span><span class="annot"><span class="annottext">DynFlags -&gt; (FilePath -&gt; m a) -&gt; MsgDoc -&gt; MsgDoc -&gt; m a
forall a. DynFlags -&gt; (FilePath -&gt; a) -&gt; MsgDoc -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprDebugAndThen"><span class="hs-identifier hs-var">pprDebugAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825844"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; m a
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825841"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825840"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-818"></span><span>                      </span><span class="annot"><a href="GHC.Utils.Panic.html#PprSorry"><span class="hs-identifier hs-type">PprSorry</span></a></span><span> </span><span id="local-6989586621680825837"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825837"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621680825836"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825836"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-819"></span><span>                          </span><span class="annot"><span class="annottext">DynFlags -&gt; (FilePath -&gt; m a) -&gt; MsgDoc -&gt; MsgDoc -&gt; m a
forall a. DynFlags -&gt; (FilePath -&gt; a) -&gt; MsgDoc -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprDebugAndThen"><span class="hs-identifier hs-var">pprDebugAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825844"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; m a
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#sorry"><span class="hs-identifier hs-var">sorry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825837"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825836"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-820"></span><span>                      </span><span class="annot"><a href="GHC.Utils.Panic.html#PprProgramError"><span class="hs-identifier hs-type">PprProgramError</span></a></span><span> </span><span id="local-6989586621680825833"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825833"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span id="local-6989586621680825832"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825832"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-821"></span><span>                          </span><span class="annot"><span class="annottext">DynFlags -&gt; (FilePath -&gt; m a) -&gt; MsgDoc -&gt; MsgDoc -&gt; m a
forall a. DynFlags -&gt; (FilePath -&gt; a) -&gt; MsgDoc -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprDebugAndThen"><span class="hs-identifier hs-var">pprDebugAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825844"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; m a
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#pgmError"><span class="hs-identifier hs-var">pgmError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825833"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825832"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-822"></span><span>                      </span><span class="annot"><span class="annottext">GhcException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-823"></span><span>                          </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; m a) -&gt; IO a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">GhcException
</span><a href="#local-6989586621680825843"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span class="hs-comment">-- | Checks if given 'WarnMsg' is a fatal warning.</span><span>
</span><span id="line-826"></span><span class="annot"><a href="GHC.Utils.Error.html#isWarnMsgFatal"><span class="hs-identifier hs-type">isWarnMsgFatal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#WarnMsg"><span class="hs-identifier hs-type">WarnMsg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarningFlag"><span class="hs-identifier hs-type">WarningFlag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span id="isWarnMsgFatal"><span class="annot"><span class="annottext">isWarnMsgFatal :: DynFlags -&gt; ErrMsg -&gt; Maybe (Maybe WarningFlag)
</span><a href="GHC.Utils.Error.html#isWarnMsgFatal"><span class="hs-identifier hs-var hs-var">isWarnMsgFatal</span></a></span></span><span> </span><span id="local-6989586621680825829"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825829"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#ErrMsg"><span class="hs-identifier hs-type">ErrMsg</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">errMsgReason :: ErrMsg -&gt; WarnReason
</span><a href="GHC.Utils.Error.html#errMsgReason"><span class="hs-identifier hs-var">errMsgReason</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-type">Reason</span></a></span><span> </span><span id="local-6989586621680825827"><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621680825827"><span class="hs-identifier hs-var">wflag</span></a></span></span><span class="hs-special">}</span><span>
</span><span id="line-828"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt_fatal"><span class="hs-identifier hs-var">wopt_fatal</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621680825827"><span class="hs-identifier hs-var">wflag</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825829"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-829"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe WarningFlag -&gt; Maybe (Maybe WarningFlag)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; Maybe WarningFlag
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621680825827"><span class="hs-identifier hs-var">wflag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-830"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe WarningFlag)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-831"></span><span class="annot"><a href="GHC.Utils.Error.html#isWarnMsgFatal"><span class="hs-identifier hs-var">isWarnMsgFatal</span></a></span><span> </span><span id="local-6989586621680825825"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825825"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="annot"><span class="annottext">ErrMsg
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-832"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnIsError"><span class="hs-identifier hs-var">Opt_WarnIsError</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825825"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-833"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe WarningFlag -&gt; Maybe (Maybe WarningFlag)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe WarningFlag
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-834"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe WarningFlag)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-835"></span><span>
</span><span id="line-836"></span><span id="local-6989586621680826569"><span class="annot"><a href="GHC.Utils.Error.html#traceCmd"><span class="hs-identifier hs-type">traceCmd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621680826569"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621680826569"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-837"></span><span class="hs-comment">-- trace the command (at two levels of verbosity)</span><span>
</span><span id="line-838"></span><span id="traceCmd"><span class="annot"><span class="annottext">traceCmd :: forall a. DynFlags -&gt; FilePath -&gt; FilePath -&gt; IO a -&gt; IO a
</span><a href="GHC.Utils.Error.html#traceCmd"><span class="hs-identifier hs-var hs-var">traceCmd</span></a></span></span><span> </span><span id="local-6989586621680825818"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825817"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825817"><span class="hs-identifier hs-var">phase_name</span></a></span></span><span> </span><span id="local-6989586621680825816"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825816"><span class="hs-identifier hs-var">cmd_line</span></a></span></span><span> </span><span id="local-6989586621680825815"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621680825815"><span class="hs-identifier hs-var">action</span></a></span></span><span>
</span><span id="line-839"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680825814"><span class="annot"><span class="annottext">verb :: Int
</span><a href="#local-6989586621680825814"><span class="hs-identifier hs-var hs-var">verb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-840"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier hs-var">showPass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825817"><span class="hs-identifier hs-var">phase_name</span></a></span><span>
</span><span id="line-841"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825816"><span class="hs-identifier hs-var">cmd_line</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-842"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FlushErr
</span><a href="GHC.Driver.Session.html#flushErr"><span class="hs-identifier hs-var hs-var">flushErr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-843"></span><span>              </span><span class="annot"><a href="GHC.Driver.Session.html#FlushErr"><span class="hs-identifier hs-type">FlushErr</span></a></span><span> </span><span id="local-6989586621680825811"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680825811"><span class="hs-identifier hs-var">io</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621680825811"><span class="hs-identifier hs-var">io</span></a></span><span>
</span><span id="line-844"></span><span>
</span><span id="line-845"></span><span>           </span><span class="hs-comment">-- And run it!</span><span>
</span><span id="line-846"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621680825815"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a
</span><a href="GHC.Utils.Exception.html#catchIO"><span class="hs-operator hs-var">`catchIO`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; IOError -&gt; IO a
forall {a} {p} {b}. Show a =&gt; p -&gt; a -&gt; IO b
</span><a href="#local-6989586621680825809"><span class="hs-identifier hs-var">handle_exn</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680825814"><span class="hs-identifier hs-var">verb</span></a></span><span>
</span><span id="line-847"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-848"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-849"></span><span>    </span><span id="local-6989586621680825809"><span class="annot"><span class="annottext">handle_exn :: p -&gt; a -&gt; IO b
</span><a href="#local-6989586621680825809"><span class="hs-identifier hs-var hs-var">handle_exn</span></a></span></span><span> </span><span id="local-6989586621680825803"><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621680825803"><span class="hs-identifier hs-var">_verb</span></a></span></span><span> </span><span id="local-6989586621680825802"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825802"><span class="hs-identifier hs-var">exn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span>
</span><span id="line-850"></span><span>                              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-851"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Failed:&quot;</span></span><span>
</span><span id="line-852"></span><span>                                 </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825816"><span class="hs-identifier hs-var">cmd_line</span></a></span><span>
</span><span id="line-853"></span><span>                                 </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825802"><span class="hs-identifier hs-var">exn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-854"></span><span>                              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GhcException -&gt; IO b
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; FilePath
forall a. Show a =&gt; a -&gt; FilePath
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680825802"><span class="hs-identifier hs-var">exn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-855"></span><span>
</span><span id="line-856"></span><span class="hs-comment">{- Note [withTiming]
~~~~~~~~~~~~~~~~~~~~

For reference:

  withTiming
    :: MonadIO
    =&gt; m DynFlags   -- how to get the DynFlags
    -&gt; SDoc         -- label for the computation we're timing
    -&gt; (a -&gt; ())    -- how to evaluate the result
    -&gt; PrintTimings -- whether to report the timings when passed
                    -- -v2 or -ddump-timings
    -&gt; m a          -- computation we're timing
    -&gt; m a

withTiming lets you run an action while:

(1) measuring the CPU time it took and reporting that on stderr
    (when PrintTimings is passed),
(2) emitting start/stop events to GHC's event log, with the label
    given as an argument.

Evaluation of the result
------------------------

'withTiming' takes as an argument a function of type 'a -&gt; ()', whose purpose is
to evaluate the result &quot;sufficiently&quot;. A given pass might return an 'm a' for
some monad 'm' and result type 'a', but where the 'a' is complex enough
that evaluating it to WHNF barely scratches its surface and leaves many
complex and time-consuming computations unevaluated. Those would only be
forced by the next pass, and the time needed to evaluate them would be
mis-attributed to that next pass. A more appropriate function would be
one that deeply evaluates the result, so as to assign the time spent doing it
to the pass we're timing.

Note: as hinted at above, the time spent evaluating the application of the
forcing function to the result is included in the timings reported by
'withTiming'.

How we use it
-------------

We measure the time and allocations of various passes in GHC's pipeline by just
wrapping the whole pass with 'withTiming'. This also materializes by having
a label for each pass in the eventlog, where each pass is executed in one go,
during a continuous time window.

However, from STG onwards, the pipeline uses streams to emit groups of
STG/Cmm/etc declarations one at a time, and process them until we get to
assembly code generation. This means that the execution of those last few passes
is interleaved and that we cannot measure how long they take by just wrapping
the whole thing with 'withTiming'. Instead we wrap the processing of each
individual stream element, all along the codegen pipeline, using the appropriate
label for the pass to which this processing belongs. That generates a lot more
data but allows us to get fine-grained timings about all the passes and we can
easily compute totals with tools like ghc-events-analyze (see below).


Producing an eventlog for GHC
-----------------------------

To actually produce the eventlog, you need an eventlog-capable GHC build:

  With Hadrian:
  $ hadrian/build -j &quot;stage1.ghc-bin.ghc.link.opts += -eventlog&quot;

  With Make:
  $ make -j GhcStage2HcOpts+=-eventlog

You can then produce an eventlog when compiling say hello.hs by simply
doing:

  If GHC was built by Hadrian:
  $ _build/stage1/bin/ghc -ddump-timings hello.hs -o hello +RTS -l

  If GHC was built with Make:
  $ inplace/bin/ghc-stage2 -ddump-timing hello.hs -o hello +RTS -l

You could alternatively use -v&lt;N&gt; (with N &gt;= 2) instead of -ddump-timings,
to ask GHC to report timings (on stderr and the eventlog).

This will write the eventlog to ./ghc.eventlog in both cases. You can then
visualize it or look at the totals for each label by using ghc-events-analyze,
threadscope or any other eventlog consumer. Illustrating with
ghc-events-analyze:

  $ ghc-events-analyze --timed --timed-txt --totals \
                       --start &quot;GHC:started:&quot; --stop &quot;GHC:finished:&quot; \
                       ghc.eventlog

This produces ghc.timed.txt (all event timestamps), ghc.timed.svg (visualisation
of the execution through the various labels) and ghc.totals.txt (total time
spent in each label).

-}</span><span>
</span><span id="line-951"></span><span>
</span><span id="line-952"></span><span>
</span><span id="line-953"></span><span class="hs-comment">-- | Format of a dump</span><span>
</span><span id="line-954"></span><span class="hs-comment">--</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- Dump formats are loosely defined: dumps may contain various additional</span><span>
</span><span id="line-956"></span><span class="hs-comment">-- headers and annotations and they may be partial. 'DumpFormat' is mainly a hint</span><span>
</span><span id="line-957"></span><span class="hs-comment">-- (e.g. for syntax highlighters).</span><span>
</span><span id="line-958"></span><span class="hs-keyword">data</span><span> </span><span id="DumpFormat"><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier hs-var">DumpFormat</span></a></span></span><span>
</span><span id="line-959"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="FormatHaskell"><span class="annot"><a href="GHC.Utils.Error.html#FormatHaskell"><span class="hs-identifier hs-var">FormatHaskell</span></a></span></span><span>   </span><span class="hs-comment">-- ^ Haskell</span><span>
</span><span id="line-960"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatCore"><span class="annot"><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Core</span><span>
</span><span id="line-961"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatSTG"><span class="annot"><a href="GHC.Utils.Error.html#FormatSTG"><span class="hs-identifier hs-var">FormatSTG</span></a></span></span><span>       </span><span class="hs-comment">-- ^ STG</span><span>
</span><span id="line-962"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatByteCode"><span class="annot"><a href="GHC.Utils.Error.html#FormatByteCode"><span class="hs-identifier hs-var">FormatByteCode</span></a></span></span><span>  </span><span class="hs-comment">-- ^ ByteCode</span><span>
</span><span id="line-963"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatCMM"><span class="annot"><a href="GHC.Utils.Error.html#FormatCMM"><span class="hs-identifier hs-var">FormatCMM</span></a></span></span><span>       </span><span class="hs-comment">-- ^ Cmm</span><span>
</span><span id="line-964"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatASM"><span class="annot"><a href="GHC.Utils.Error.html#FormatASM"><span class="hs-identifier hs-var">FormatASM</span></a></span></span><span>       </span><span class="hs-comment">-- ^ Assembly code</span><span>
</span><span id="line-965"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatC"><span class="annot"><a href="GHC.Utils.Error.html#FormatC"><span class="hs-identifier hs-var">FormatC</span></a></span></span><span>         </span><span class="hs-comment">-- ^ C code/header</span><span>
</span><span id="line-966"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatLLVM"><span class="annot"><a href="GHC.Utils.Error.html#FormatLLVM"><span class="hs-identifier hs-var">FormatLLVM</span></a></span></span><span>      </span><span class="hs-comment">-- ^ LLVM bytecode</span><span>
</span><span id="line-967"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="FormatText"><span class="annot"><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span></span><span>      </span><span class="hs-comment">-- ^ Unstructured dump</span><span>
</span><span id="line-968"></span><span>   </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680825785"><span id="local-6989586621680825787"><span id="local-6989586621680825789"><span class="annot"><span class="annottext">Int -&gt; DumpFormat -&gt; ShowS
[DumpFormat] -&gt; ShowS
DumpFormat -&gt; FilePath
(Int -&gt; DumpFormat -&gt; ShowS)
-&gt; (DumpFormat -&gt; FilePath)
-&gt; ([DumpFormat] -&gt; ShowS)
-&gt; Show DumpFormat
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; FilePath) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [DumpFormat] -&gt; ShowS
$cshowList :: [DumpFormat] -&gt; ShowS
show :: DumpFormat -&gt; FilePath
$cshow :: DumpFormat -&gt; FilePath
showsPrec :: Int -&gt; DumpFormat -&gt; ShowS
$cshowsPrec :: Int -&gt; DumpFormat -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span id="local-6989586621680825781"><span id="local-6989586621680825783"><span class="annot"><span class="annottext">DumpFormat -&gt; DumpFormat -&gt; Bool
(DumpFormat -&gt; DumpFormat -&gt; Bool)
-&gt; (DumpFormat -&gt; DumpFormat -&gt; Bool) -&gt; Eq DumpFormat
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: DumpFormat -&gt; DumpFormat -&gt; Bool
$c/= :: DumpFormat -&gt; DumpFormat -&gt; Bool
== :: DumpFormat -&gt; DumpFormat -&gt; Bool
$c== :: DumpFormat -&gt; DumpFormat -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-969"></span><span>
</span><span id="line-970"></span><span class="hs-keyword">type</span><span> </span><span id="DumpAction"><span class="annot"><a href="GHC.Utils.Error.html#DumpAction"><span class="hs-identifier hs-var">DumpAction</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PprStyle"><span class="hs-identifier hs-type">PprStyle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpOptions"><span class="hs-identifier hs-type">DumpOptions</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-971"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier hs-type">DumpFormat</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>
</span><span id="line-973"></span><span class="hs-keyword">type</span><span> </span><span id="TraceAction"><span class="annot"><a href="GHC.Utils.Error.html#TraceAction"><span class="hs-identifier hs-var">TraceAction</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621680825780"><span class="annot"><a href="#local-6989586621680825780"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825780"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680825780"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-974"></span><span>
</span><span id="line-975"></span><span class="hs-comment">-- | Default action for 'dumpAction' hook</span><span>
</span><span id="line-976"></span><span class="annot"><a href="GHC.Utils.Error.html#defaultDumpAction"><span class="hs-identifier hs-type">defaultDumpAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpAction"><span class="hs-identifier hs-type">DumpAction</span></a></span><span>
</span><span id="line-977"></span><span id="defaultDumpAction"><span class="annot"><span class="annottext">defaultDumpAction :: DumpAction
</span><a href="GHC.Utils.Error.html#defaultDumpAction"><span class="hs-identifier hs-var hs-var">defaultDumpAction</span></a></span></span><span> </span><span id="local-6989586621680825779"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825779"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825778"><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680825778"><span class="hs-identifier hs-var">sty</span></a></span></span><span> </span><span id="local-6989586621680825777"><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680825777"><span class="hs-identifier hs-var">dumpOpt</span></a></span></span><span> </span><span id="local-6989586621680825776"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825776"><span class="hs-identifier hs-var">title</span></a></span></span><span> </span><span id="local-6989586621680825775"><span class="annot"><span class="annottext">DumpFormat
</span><a href="#local-6989586621680825775"><span class="hs-identifier hs-var">_fmt</span></a></span></span><span> </span><span id="local-6989586621680825774"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825774"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-978"></span><span>   </span><span class="annot"><span class="annottext">PprStyle -&gt; DynFlags -&gt; DumpOptions -&gt; FilePath -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpSDocWithStyle"><span class="hs-identifier hs-var">dumpSDocWithStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="#local-6989586621680825778"><span class="hs-identifier hs-var">sty</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825779"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpOptions
</span><a href="#local-6989586621680825777"><span class="hs-identifier hs-var">dumpOpt</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825776"><span class="hs-identifier hs-var">title</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825774"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-979"></span><span>
</span><span id="line-980"></span><span class="hs-comment">-- | Default action for 'traceAction' hook</span><span>
</span><span id="line-981"></span><span class="annot"><a href="GHC.Utils.Error.html#defaultTraceAction"><span class="hs-identifier hs-type">defaultTraceAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#TraceAction"><span class="hs-identifier hs-type">TraceAction</span></a></span><span>
</span><span id="line-982"></span><span id="defaultTraceAction"><span class="annot"><span class="annottext">defaultTraceAction :: TraceAction
</span><a href="GHC.Utils.Error.html#defaultTraceAction"><span class="hs-identifier hs-var hs-var">defaultTraceAction</span></a></span></span><span> </span><span id="local-6989586621680825773"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825773"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680825772"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825772"><span class="hs-identifier hs-var">title</span></a></span></span><span> </span><span id="local-6989586621680825771"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825771"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; MsgDoc -&gt; a -&gt; a
TraceAction
</span><a href="GHC.Utils.Outputable.html#pprTraceWithFlags"><span class="hs-identifier hs-var">pprTraceWithFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825773"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621680825772"><span class="hs-identifier hs-var">title</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621680825771"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-983"></span><span>
</span><span id="line-984"></span><span class="hs-comment">-- | Helper for `dump_action`</span><span>
</span><span id="line-985"></span><span class="annot"><a href="GHC.Utils.Error.html#dumpAction"><span class="hs-identifier hs-type">dumpAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpAction"><span class="hs-identifier hs-type">DumpAction</span></a></span><span>
</span><span id="line-986"></span><span id="dumpAction"><span class="annot"><span class="annottext">dumpAction :: DumpAction
</span><a href="GHC.Utils.Error.html#dumpAction"><span class="hs-identifier hs-var hs-var">dumpAction</span></a></span></span><span> </span><span id="local-6989586621680825769"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825769"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpAction
</span><a href="GHC.Driver.Session.html#dump_action"><span class="hs-identifier hs-var hs-var">dump_action</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825769"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825769"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-987"></span><span>
</span><span id="line-988"></span><span class="hs-comment">-- | Helper for `trace_action`</span><span>
</span><span id="line-989"></span><span class="annot"><a href="GHC.Utils.Error.html#traceAction"><span class="hs-identifier hs-type">traceAction</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#TraceAction"><span class="hs-identifier hs-type">TraceAction</span></a></span><span>
</span><span id="line-990"></span><span id="traceAction"><span class="annot"><span class="annottext">traceAction :: TraceAction
</span><a href="GHC.Utils.Error.html#traceAction"><span class="hs-identifier hs-var hs-var">traceAction</span></a></span></span><span> </span><span id="local-6989586621680825767"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825767"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; TraceAction
</span><a href="GHC.Driver.Session.html#trace_action"><span class="hs-identifier hs-var hs-var">trace_action</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825767"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680825767"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-991"></span></pre></body></html>